From 8bb980a374a3482ddc25ab2d627d171ba4084b44 Mon Sep 17 00:00:00 2001 From: CSRG Date: Wed, 21 Jul 1993 06:50:05 -0800 Subject: [PATCH] BSD 4_4 development Work on file usr/share/man/cat2/sethostid.0 Work on file usr/share/man/cat2/creat.0 Work on file usr/share/man/cat2/killpg.0 Work on file usr/share/man/cat2/setregid.0 Work on file usr/share/man/cat2/gethostid.0 Work on file usr/share/man/cat2/access.0 Work on file usr/share/man/cat2/setruid.0 Work on file usr/share/man/cat2/accept.0 Work on file usr/share/man/cat2/acct.0 Work on file usr/share/man/cat2/sigvec.0 Work on file usr/share/man/cat2/sigblock.0 Work on file usr/share/man/cat2/sigsetmask.0 Work on file usr/share/man/cat2/setrgid.0 Work on file usr/share/man/cat2/sigpause.0 Work on file usr/share/man/cat2/setreuid.0 Work on file usr/share/man/cat2/brk.0 Work on file usr/share/man/cat2/fchflags.0 Work on file usr/share/man/cat2/fchmod.0 Work on file usr/share/man/cat2/chown.0 Work on file usr/share/man/cat2/chroot.0 Work on file usr/share/man/cat2/sbrk.0 Work on file usr/share/man/cat2/chmod.0 Work on file usr/share/man/cat2/fchown.0 Work on file usr/share/man/cat2/chdir.0 Work on file usr/share/man/cat2/fchdir.0 Work on file usr/share/man/cat2/close.0 Work on file usr/share/man/cat2/bind.0 Work on file usr/share/man/cat2/chflags.0 Work on file usr/share/man/cat2/adjtime.0 Work on file usr/share/man/cat2/connect.0 Work on file usr/share/man/cat2/dup2.0 Work on file usr/share/man/cat2/execve.0 Work on file usr/share/man/cat2/fork.0 Work on file usr/share/man/cat2/fsync.0 Work on file usr/share/man/cat2/flock.0 Work on file usr/share/man/cat2/_exit.0 Work on file usr/share/man/cat2/fcntl.0 Work on file usr/share/man/cat2/dup.0 Work on file usr/share/man/cat2/getfh.0 Work on file usr/share/man/cat2/getitimer.0 Work on file usr/share/man/cat2/setitimer.0 Work on file usr/share/man/cat2/setlogin.0 Work on file usr/share/man/cat2/getgid.0 Work on file usr/share/man/cat2/getlogin.0 Work on file usr/share/man/cat2/getgroups.0 Work on file usr/share/man/cat2/getpeername.0 Work on file usr/share/man/cat2/getfsstat.0 Work on file usr/share/man/cat2/getdtablesize.0 Work on file usr/share/man/cat2/getegid.0 Work on file usr/share/man/cat2/getdirentries.0 Work on file usr/share/man/cat2/getpid.0 Work on file usr/share/man/cat2/setpriority.0 Work on file usr/share/man/cat2/getsockopt.0 Work on file usr/share/man/cat2/setrlimit.0 Work on file usr/share/man/cat2/settimeofday.0 Work on file usr/share/man/cat2/getppid.0 Work on file usr/share/man/cat2/getpgrp.0 Work on file usr/share/man/cat2/getsockname.0 Work on file usr/share/man/cat2/getpriority.0 Work on file usr/share/man/cat2/setsockopt.0 Work on file usr/share/man/cat2/getrlimit.0 Work on file usr/share/man/cat2/gettimeofday.0 Work on file usr/share/man/cat2/getrusage.0 Work on file usr/share/man/cat2/ioctl.0 Work on file usr/share/man/cat2/link.0 Work on file usr/share/man/cat2/getuid.0 Work on file usr/share/man/cat2/geteuid.0 Work on file usr/share/man/cat2/intro.0 Work on file usr/share/man/cat2/seek.0 Work on file usr/share/man/cat2/lseek.0 Work on file usr/share/man/cat2/ktrace.0 Work on file usr/share/man/cat2/errno.0 Work on file usr/share/man/cat2/listen.0 Work on file usr/share/man/cat2/kill.0 Work on file usr/share/man/cat2/munlock.0 Work on file usr/share/man/cat2/mkfifo.0 Work on file usr/share/man/cat2/mincore.0 Work on file usr/share/man/cat2/mmap.0 Work on file usr/share/man/cat2/mkdir.0 Work on file usr/share/man/cat2/mknod.0 Work on file usr/share/man/cat2/madvise.0 Work on file usr/share/man/cat2/mlock.0 Work on file usr/share/man/cat2/pathconf.0 Work on file usr/share/man/cat2/msync.0 Work on file usr/share/man/cat2/mprotect.0 Work on file usr/share/man/cat2/mount.0 Work on file usr/share/man/cat2/fpathconf.0 Work on file usr/share/man/cat2/unmount.0 Work on file usr/share/man/cat2/nfssvc.0 Work on file usr/share/man/cat2/munmap.0 Work on file usr/share/man/cat2/open.0 Work on file usr/share/man/cat2/read.0 Work on file usr/share/man/cat2/ptrace.0 Work on file usr/share/man/cat2/profil.0 Work on file usr/share/man/cat2/readv.0 Work on file usr/share/man/cat2/quotactl.0 Work on file usr/share/man/cat2/readlink.0 Work on file usr/share/man/cat2/pipe.0 Work on file usr/share/man/cat2/reboot.0 Work on file usr/share/man/cat2/recvfrom.0 Work on file usr/share/man/cat2/sendto.0 Work on file usr/share/man/cat2/setgroups.0 Work on file usr/share/man/cat2/setsid.0 Work on file usr/share/man/cat2/rmdir.0 Work on file usr/share/man/cat2/send.0 Work on file usr/share/man/cat2/revoke.0 Work on file usr/share/man/cat2/recvmsg.0 Work on file usr/share/man/cat2/recv.0 Work on file usr/share/man/cat2/sendmsg.0 Work on file usr/share/man/cat2/rename.0 Work on file usr/share/man/cat2/select.0 Work on file usr/share/man/cat2/seteuid.0 Work on file usr/share/man/cat2/shutdown.0 Work on file usr/share/man/cat2/sigprocmask.0 Work on file usr/share/man/cat2/setgid.0 Work on file usr/share/man/cat2/sigstack.0 Work on file usr/share/man/cat2/sigreturn.0 Work on file usr/share/man/cat2/setegid.0 Work on file usr/share/man/cat2/setuid.0 Work on file usr/share/man/cat2/sigaction.0 Work on file usr/share/man/cat2/sigaltstack.0 Work on file usr/share/man/cat2/sigpending.0 Work on file usr/share/man/cat2/sigsuspend.0 Work on file usr/share/man/cat2/fstatfs.0 Work on file usr/share/man/cat2/socketpair.0 Work on file usr/share/man/cat2/__syscall.0 Work on file usr/share/man/cat2/fstat.0 Work on file usr/share/man/cat2/sync.0 Work on file usr/share/man/cat2/stat.0 Work on file usr/share/man/cat2/symlink.0 Work on file usr/share/man/cat2/syscall.0 Work on file usr/share/man/cat2/lstat.0 Work on file usr/share/man/cat2/socket.0 Work on file usr/share/man/cat2/swapon.0 Work on file usr/share/man/cat2/truncate.0 Work on file usr/share/man/cat2/ftruncate.0 Work on file usr/share/man/cat2/statfs.0 Work on file usr/share/man/cat2/writev.0 Work on file usr/share/man/cat2/vfork.0 Work on file usr/share/man/cat2/wait4.0 Work on file usr/share/man/cat2/write.0 Work on file usr/share/man/cat2/umask.0 Work on file usr/share/man/cat2/utimes.0 Work on file usr/share/man/cat2/waitpid.0 Work on file usr/share/man/cat2/wait3.0 Work on file usr/share/man/cat2/unlink.0 Work on file usr/share/man/cat2/wait.0 Work on file usr/share/man/cat3/db.0 Work on file usr/share/man/cat3/dbopen.0 Work on file usr/share/man/cat3/hash.0 Work on file usr/share/man/cat3/btree.0 Work on file usr/share/man/cat3/difftime.0 Work on file usr/share/man/cat3/confstr.0 Work on file usr/share/man/cat3/crypt.0 Work on file usr/share/man/cat3/asctime.0 Work on file usr/share/man/cat3/encrypt.0 Work on file usr/share/man/cat3/alarm.0 Work on file usr/share/man/cat3/recno.0 Work on file usr/share/man/cat3/gmtime.0 Work on file usr/share/man/cat3/setkey.0 Work on file usr/share/man/cat3/ctime.0 Work on file usr/src/Domestic/man/crypt.0.3 Work on file usr/share/man/cat3/localtime.0 Work on file usr/share/man/cat3/daemon.0 Work on file usr/share/man/cat3/devname.0 Work on file usr/share/man/cat3/mktime.0 Work on file usr/share/man/cat3/ctermid.0 Work on file usr/share/man/cat3/clock.0 Work on file usr/share/man/cat3/rewinddir.0 Work on file usr/share/man/cat3/opendir.0 Work on file usr/share/man/cat3/verr.0 Work on file usr/share/man/cat3/closedir.0 Work on file usr/share/man/cat3/directory.0 Work on file usr/share/man/cat3/frexp.0 Work on file usr/share/man/cat3/vwarn.0 Work on file usr/share/man/cat3/execv.0 Work on file usr/share/man/cat3/fnmatch.0 Work on file usr/share/man/cat3/errx.0 Work on file usr/share/man/cat3/telldir.0 Work on file usr/share/man/cat3/warnx.0 Work on file usr/share/man/cat3/exec.0 Work on file usr/share/man/cat3/execvp.0 Work on file usr/share/man/cat3/err.0 Work on file usr/share/man/cat3/getbsize.0 Work on file usr/share/man/cat3/seekdir.0 Work on file usr/share/man/cat3/execlp.0 Work on file usr/share/man/cat3/dirfd.0 Work on file usr/share/man/cat3/warn.0 Work on file usr/share/man/cat3/execl.0 Work on file usr/share/man/cat3/readdir.0 Work on file usr/share/man/cat3/execle.0 Work on file usr/share/man/cat3/vwarnx.0 Work on file usr/share/man/cat3/verrx.0 Work on file usr/share/man/cat3/fts.0 Work on file usr/share/man/cat3/getgrgid.0 Work on file usr/share/man/cat3/cgetustr.0 Work on file usr/share/man/cat3/getgrouplist.0 Work on file usr/share/man/cat3/setgrent.0 Work on file usr/share/man/cat3/setfsent.0 Work on file usr/share/man/cat3/cgetmatch.0 Work on file usr/share/man/cat3/setgroupent.0 Work on file usr/share/man/cat3/cgetclose.0 Work on file usr/share/man/cat3/endgrent.0 Work on file usr/share/man/cat3/getfsspec.0 Work on file usr/share/man/cat3/cgetnum.0 Work on file usr/share/man/cat3/getcap.0 Work on file usr/share/man/cat3/getfsfile.0 Work on file usr/share/man/cat3/getfsent.0 Work on file usr/share/man/cat3/cgetcap.0 Work on file usr/share/man/cat3/getdiskbyname.0 Work on file usr/share/man/cat3/endfsent.0 Work on file usr/share/man/cat3/cgetent.0 Work on file usr/share/man/cat3/getgrent.0 Work on file usr/share/man/cat3/cgetstr.0 Work on file usr/share/man/cat3/getfstype.0 Work on file usr/share/man/cat3/cgetset.0 Work on file usr/share/man/cat3/cgetnext.0 Work on file usr/share/man/cat3/cgetfirst.0 Work on file usr/share/man/cat3/getgrnam.0 Work on file usr/share/man/cat3/setgrfile.0 Work on file usr/share/man/cat3/getusershell.0 Work on file usr/share/man/cat3/sethostname.0 Work on file usr/share/man/cat3/getpass.0 Work on file usr/share/man/cat3/setpwent.0 Work on file usr/share/man/cat3/getpwuid.0 Work on file usr/share/man/cat3/setpwfile.0 Work on file usr/share/man/cat3/setusershell.0 Work on file usr/share/man/cat3/setttyent.0 Work on file usr/share/man/cat3/getloadavg.0 Work on file usr/share/man/cat3/getpwnam.0 Work on file usr/share/man/cat3/setnetgrent.0 Work on file usr/share/man/cat3/getpwent.0 Work on file usr/share/man/cat3/getnetgrent.0 Work on file usr/share/man/cat3/setpassent.0 Work on file usr/share/man/cat3/endusershell.0 Work on file usr/share/man/cat3/getmntinfo.0 Work on file usr/share/man/cat3/getpagesize.0 Work on file usr/share/man/cat3/innetgr.0 Work on file usr/share/man/cat3/endnetgrent.0 Work on file usr/share/man/cat3/endpwent.0 Work on file usr/share/man/cat3/getttyent.0 Work on file usr/share/man/cat3/getttynam.0 Work on file usr/share/man/cat3/gethostname.0 Work on file usr/share/man/cat3/endttyent.0 Work on file usr/share/man/cat3/pause.0 Work on file usr/share/man/cat3/initgroups.0 Work on file usr/share/man/cat3/modf.0 Work on file usr/share/man/cat3/glob.0 Work on file usr/share/man/cat3/nlist.0 Work on file usr/share/man/cat3/globfree.0 Work on file usr/share/man/cat3/isinf.0 Work on file usr/share/man/cat3/ldexp.0 Work on file usr/share/man/cat3/nice.0 Work on file usr/share/man/cat3/isnan.0 Work on file usr/share/man/cat3/longjmperr.0 Work on file usr/share/man/cat3/popen.0 Work on file usr/share/man/cat3/siginterrupt.0 Work on file usr/share/man/cat3/_longjmp.0 Work on file usr/share/man/cat3/scandir.0 Work on file usr/share/man/cat3/sigsetjmp.0 Work on file usr/share/man/cat3/user_from_uid.0 Work on file usr/share/man/cat3/psignal.0 Work on file usr/share/man/cat3/raise.0 Work on file usr/share/man/cat3/siglongjmp.0 Work on file usr/share/man/cat3/getmode.0 Work on file usr/share/man/cat3/signal.0 Work on file usr/share/man/cat3/_setjmp.0 Work on file usr/share/man/cat3/setjmp.0 Work on file usr/share/man/cat3/setmode.0 Work on file usr/share/man/cat3/pclose.0 Work on file usr/share/man/cat3/longjmp.0 Work on file usr/share/man/cat3/alphasort.0 Work on file usr/share/man/cat3/group_from_gid.0 Work on file usr/share/man/cat3/sys_siglist.0 Work on file usr/share/man/cat3/longjmperror.0 Work on file usr/share/man/cat3/pwcache.0 Work on file usr/share/man/cat3/vsyslog.0 Work on file usr/share/man/cat3/cfgetospeed.0 Work on file usr/share/man/cat3/cfgetispeed.0 Work on file usr/share/man/cat3/tcgetattr.0 Work on file usr/share/man/cat3/sigfillset.0 Work on file usr/share/man/cat3/sigemptyset.0 Work on file usr/share/man/cat3/cfsetispeed.0 Work on file usr/share/man/cat3/setlogmask.0 Work on file usr/share/man/cat3/cfsetspeed.0 Work on file usr/share/man/cat3/sysconf.0 Work on file usr/share/man/cat3/syslog.0 Work on file usr/share/man/cat3/tcflush.0 Work on file usr/share/man/cat3/cfmakeraw.0 Work on file usr/share/man/cat3/tcflow.0 Work on file usr/share/man/cat3/cfsetospeed.0 Work on file usr/share/man/cat3/tcsetattr.0 Work on file usr/share/man/cat3/sleep.0 Work on file usr/share/man/cat3/sigdelset.0 Work on file usr/share/man/cat3/sigismember.0 Work on file usr/share/man/cat3/sigaddset.0 Work on file usr/share/man/cat3/closelog.0 Work on file usr/share/man/cat3/tcgetpgrp.0 Work on file usr/share/man/cat3/sysctl.0 Work on file usr/share/man/cat3/tcsendbreak.0 Work on file usr/share/man/cat3/openlog.0 Work on file usr/share/man/cat3/sigsetops.0 Work on file usr/share/man/cat3/tcdrain.0 Work on file usr/share/man/cat3/tzsetwall.0 Work on file usr/share/man/cat3/tcsetpgrp.0 Work on file usr/share/man/cat3/timezone.0 Work on file usr/share/man/cat3/times.0 Work on file usr/share/man/cat3/ualarm.0 Work on file usr/share/man/cat3/time.0 Work on file usr/share/man/cat3/tzset.0 Work on file usr/share/man/cat3/isatty.0 Work on file usr/share/man/cat3/ttyslot.0 Work on file usr/share/man/cat3/unvis.0 Work on file usr/share/man/cat3/ttyname.0 Work on file usr/share/man/cat3/isalnum.0 Work on file usr/share/man/cat3/isalpha.0 Work on file usr/share/man/cat3/valloc.0 Work on file usr/share/man/cat3/utime.0 Work on file usr/share/man/cat3/ctype.0 Work on file usr/share/man/cat3/monstartup.0 Work on file usr/share/man/cat3/usleep.0 Work on file usr/share/man/cat3/moncontrol.0 Work on file usr/share/man/cat3/vis.0 Work on file usr/share/man/cat3/isblank.0 Work on file usr/share/man/cat3/isdigit.0 Work on file usr/share/man/cat3/isascii.0 Work on file usr/share/man/cat3/iscntrl.0 Work on file usr/share/man/cat3/isprint.0 Work on file usr/share/man/cat3/isgraph.0 Work on file usr/share/man/cat3/islower.0 Work on file usr/share/man/cat3/ispunct.0 Work on file usr/share/man/cat3/multibyte.0 Work on file usr/share/man/cat3/setlocale.0 Work on file usr/share/man/cat3/isxdigit.0 Work on file usr/share/man/cat3/isspace.0 Work on file usr/share/man/cat3/mbrune.0 Work on file usr/share/man/cat3/toascii.0 Work on file usr/share/man/cat3/isupper.0 Work on file usr/share/man/cat3/rune.0 Work on file usr/share/man/cat3/inet_ntoa.0 Work on file usr/share/man/cat3/gethostbyname.0 Work on file usr/share/man/cat3/getnetent.0 Work on file usr/share/man/cat3/getservbyport.0 Work on file usr/share/man/cat3/setprotoent.0 Work on file usr/share/man/cat3/sethostent.0 Work on file usr/share/man/cat3/herror.0 Work on file usr/share/man/cat3/inet_aton.0 Work on file usr/share/man/cat3/ntohl.0 Work on file usr/share/man/cat3/byteorder.0 Work on file usr/share/man/cat3/endhostent.0 Work on file usr/share/man/cat3/ntohs.0 Work on file usr/share/man/cat3/tolower.0 Work on file usr/share/man/cat3/inet_makeaddr.0 Work on file usr/share/man/cat3/endprotoent.0 Work on file usr/share/man/cat3/inet.0 Work on file usr/share/man/cat3/setnetent.0 Work on file usr/share/man/cat3/getservent.0 Work on file usr/share/man/cat3/getprotobynumber.0 Work on file usr/share/man/cat3/inet_network.0 Work on file usr/share/man/cat3/setservent.0 Work on file usr/share/man/cat3/addr.0 Work on file usr/share/man/cat3/gethostbyaddr.0 Work on file usr/share/man/cat3/toupper.0 Work on file usr/share/man/cat3/getservbyname.0 Work on file usr/share/man/cat3/getnetbyaddr.0 Work on file usr/share/man/cat3/inet_addr.0 Work on file usr/share/man/cat3/endservent.0 Work on file usr/share/man/cat3/network.0 Work on file usr/share/man/cat3/htons.0 Work on file usr/share/man/cat3/inet_netof.0 Work on file usr/share/man/cat3/getprotoent.0 Work on file usr/share/man/cat3/gethostent.0 Work on file usr/share/man/cat3/htonl.0 Work on file usr/share/man/cat3/inet_lnaof.0 Work on file usr/share/man/cat3/getnetbyname.0 Work on file usr/share/man/cat3/getprotobyname.0 Work on file usr/share/man/cat3/endnetent.0 Work on file usr/share/man/cat3/link_ntoa.0 Work on file usr/share/man/cat3/ntoa.0 Work on file usr/share/man/cat3/dn_comp.0 Work on file usr/share/man/cat3/fclose.0 Work on file usr/share/man/cat3/dn_expand.0 Work on file usr/share/man/cat3/res_query.0 Work on file usr/share/man/cat3/rresvport.0 Work on file usr/share/man/cat3/ferror.0 Work on file usr/share/man/cat3/resolver.0 Work on file usr/share/man/cat3/regfree.0 Work on file usr/share/man/cat3/rcmd.0 Work on file usr/share/man/cat3/regex.0 Work on file usr/share/man/cat3/res_search.0 Work on file usr/share/man/cat3/feof.0 Work on file usr/share/man/cat3/fpurge.0 Work on file usr/share/man/cat3/ns_ntoa.0 Work on file usr/share/man/cat3/ns.0 Work on file usr/share/man/cat3/ruserok.0 Work on file usr/share/man/cat3/clearerr.0 Work on file usr/share/man/cat3/res_send.0 Work on file usr/share/man/cat3/fflush.0 Work on file usr/share/man/cat3/fileno.0 Work on file usr/share/man/cat3/ns_addr.0 Work on file usr/share/man/cat3/res_mkquery.0 Work on file usr/share/man/cat3/res_init.0 Work on file usr/share/man/cat3/fputs.0 Work on file usr/share/man/cat3/getchar.0 Work on file usr/share/man/cat3/fseek.0 Work on file usr/share/man/cat3/fgetline.0 Work on file usr/share/man/cat3/mkstemp.0 Work on file usr/share/man/cat3/fgetc.0 Work on file usr/share/man/cat3/getw.0 Work on file usr/share/man/cat3/funopen.0 Work on file usr/share/man/cat3/fopen.0 Work on file usr/share/man/cat3/mktemp.0 Work on file usr/share/man/cat3/ftell.0 Work on file usr/share/man/cat3/fgets.0 Work on file usr/share/man/cat3/fwrite.0 Work on file usr/share/man/cat3/gets.0 Work on file usr/share/man/cat3/fwopen.0 Work on file usr/share/man/cat3/freopen.0 Work on file usr/share/man/cat3/fgetpos.0 Work on file usr/share/man/cat3/getc.0 Work on file usr/share/man/cat3/fdopen.0 Work on file usr/share/man/cat3/rewind.0 Work on file usr/share/man/cat3/puts.0 Work on file usr/share/man/cat3/fsetpos.0 Work on file usr/share/man/cat3/fropen.0 Work on file usr/share/man/cat3/fread.0 Work on file usr/share/man/cat3/setlinebuf.0 Work on file usr/share/man/cat3/tmpnam.0 Work on file usr/share/man/cat3/ungetc.0 Work on file usr/share/man/cat3/fputc.0 Work on file usr/share/man/cat3/vsscanf.0 Work on file usr/share/man/cat3/remove.0 Work on file usr/share/man/cat3/vsnprintf.0 Work on file usr/share/man/cat3/setbuf.0 Work on file usr/share/man/cat3/scanf.0 Work on file usr/share/man/cat3/stdio.0 Work on file usr/share/man/cat3/tmpfile.0 Work on file usr/share/man/cat3/vsprintf.0 Work on file usr/share/man/cat3/vprintf.0 Work on file usr/share/man/cat3/putchar.0 Work on file usr/share/man/cat3/fscanf.0 Work on file usr/share/man/cat3/vscanf.0 Work on file usr/share/man/cat3/putc.0 Work on file usr/share/man/cat3/putw.0 Work on file usr/share/man/cat3/printf.0 Work on file usr/share/man/cat3/setbuffer.0 Work on file usr/share/man/cat3/sscanf.0 Work on file usr/share/man/cat3/tempnam.0 Work on file usr/share/man/cat3/sprintf.0 Work on file usr/share/man/cat3/fprintf.0 Work on file usr/share/man/cat3/vfprintf.0 Work on file usr/share/man/cat3/setvbuf.0 Work on file usr/share/man/cat3/snprintf.0 Work on file usr/share/man/cat3/vfscanf.0 Work on file usr/share/man/cat3/alloca.0 Work on file usr/share/man/cat3/abs.0 Work on file usr/share/man/cat3/zopen.0 Work on file usr/share/man/cat3/abort.0 Work on file usr/share/man/cat3/atexit.0 Work on file usr/share/man/cat3/atoi.0 Work on file usr/share/man/cat3/atof.0 Work on file usr/share/man/cat3/calloc.0 Work on file usr/share/man/cat3/unsetenv.0 Work on file usr/share/man/cat3/div.0 Work on file usr/share/man/cat3/getenv.0 Work on file usr/share/man/cat3/exit.0 Work on file usr/share/man/cat3/putenv.0 Work on file usr/share/man/cat3/atol.0 Work on file usr/share/man/cat3/free.0 Work on file usr/share/man/cat3/bsearch.0 Work on file usr/share/man/cat3/setenv.0 Work on file usr/share/man/cat3/malloc.0 Work on file usr/share/man/cat3/getopt.0 Work on file usr/share/man/cat3/heapsort.0 Work on file usr/share/man/cat3/srand.0 Work on file usr/share/man/cat3/labs.0 Work on file usr/share/man/cat3/rand.0 Work on file usr/share/man/cat3/memory.0 Work on file usr/share/man/cat3/getsubopt.0 Work on file usr/share/man/cat3/mergesort.0 Work on file usr/share/man/cat3/radixsort.0 Work on file usr/share/man/cat3/qsort.0 Work on file usr/share/man/cat3/ldiv.0 Work on file usr/share/man/cat3/system.0 Work on file usr/share/man/cat3/realloc.0 Work on file usr/share/man/cat3/strtoq.0 Work on file usr/share/man/cat3/strtoul.0 Work on file usr/share/man/cat3/strtouq.0 Work on file usr/share/man/cat3/strtod.0 Work on file usr/share/man/cat3/strtol.0 Work on file usr/share/man/cat3/setstate.0 Work on file usr/share/man/cat3/initstate.0 Work on file usr/share/man/cat3/random.0 Work on file usr/share/man/cat3/srandom.0 Work on file usr/share/man/cat3/bcmp.0 Work on file usr/share/man/cat3/bcopy.0 Work on file usr/share/man/cat3/memccpy.0 Work on file usr/share/man/cat3/index.0 Work on file usr/share/man/cat3/memchr.0 Work on file usr/share/man/cat3/bstring.0 Work on file usr/share/man/cat3/bzero.0 Work on file usr/share/man/cat3/ffs.0 Work on file usr/share/man/cat3/memset.0 Work on file usr/share/man/cat3/strchr.0 Work on file usr/share/man/cat3/memcmp.0 Work on file usr/share/man/cat3/strncasecmp.0 Work on file usr/share/man/cat3/memcpy.0 Work on file usr/share/man/cat3/strcmp.0 Work on file usr/share/man/cat3/memmove.0 Work on file usr/share/man/cat3/strncmp.0 Work on file usr/share/man/cat3/strncat.0 Work on file usr/share/man/cat3/strcat.0 Work on file usr/share/man/cat3/strcasecmp.0 Work on file usr/share/man/cat3/rindex.0 Work on file usr/share/man/cat3/string.0 Work on file usr/share/man/cat3/strcpy.0 Work on file usr/share/man/cat3/strftime.0 Work on file usr/share/man/cat3/strncpy.0 Work on file usr/share/man/cat3/strlen.0 Work on file usr/share/man/cat3/strmode.0 Work on file usr/share/man/cat3/strcoll.0 Work on file usr/share/man/cat3/strcspn.0 Work on file usr/share/man/cat3/strrchr.0 Work on file usr/share/man/cat3/strdup.0 Work on file usr/share/man/cat3/strsep.0 Work on file usr/share/man/cat3/strerror.0 Work on file usr/share/man/cat3/perror.0 Work on file usr/share/man/cat3/strstr.0 Work on file usr/share/man/cat3/strtok.0 Work on file usr/share/man/cat3/strspn.0 Work on file usr/share/man/cat3/strpbrk.0 Work on file usr/share/man/cat3/swab.0 Work on file usr/share/man/cat3/strxfrm.0 Work on file usr/share/man/cat4/euc.0 Work on file usr/share/man/cat7/re_format.0 Work on file usr/share/man/cat4/utf2.0 Synthesized-from: CSRG/cd3/4.4 --- usr/share/man/cat2/__syscall.0 | 37 ++ usr/share/man/cat2/_exit.0 | 52 +++ usr/share/man/cat2/accept.0 | 79 ++++ usr/share/man/cat2/access.0 | 82 ++++ usr/share/man/cat2/acct.0 | 70 ++++ usr/share/man/cat2/adjtime.0 | 55 +++ usr/share/man/cat2/bind.0 | 82 ++++ usr/share/man/cat2/brk.0 | 61 +++ usr/share/man/cat2/chdir.0 | 79 ++++ usr/share/man/cat2/chflags.0 | 90 ++++ usr/share/man/cat2/chmod.0 | 113 +++++ usr/share/man/cat2/chown.0 | 92 +++++ usr/share/man/cat2/chroot.0 | 59 +++ usr/share/man/cat2/close.0 | 57 +++ usr/share/man/cat2/connect.0 | 92 +++++ usr/share/man/cat2/creat.0 | 25 ++ usr/share/man/cat2/dup.0 | 55 +++ usr/share/man/cat2/dup2.0 | 55 +++ usr/share/man/cat2/errno.0 | 550 +++++++++++++++++++++++++ usr/share/man/cat2/execve.0 | 164 ++++++++ usr/share/man/cat2/fchdir.0 | 79 ++++ usr/share/man/cat2/fchflags.0 | 90 ++++ usr/share/man/cat2/fchmod.0 | 113 +++++ usr/share/man/cat2/fchown.0 | 92 +++++ usr/share/man/cat2/fcntl.0 | 232 +++++++++++ usr/share/man/cat2/flock.0 | 70 ++++ usr/share/man/cat2/fork.0 | 60 +++ usr/share/man/cat2/fpathconf.0 | 104 +++++ usr/share/man/cat2/fstat.0 | 157 +++++++ usr/share/man/cat2/fstatfs.0 | 93 +++++ usr/share/man/cat2/fsync.0 | 39 ++ usr/share/man/cat2/ftruncate.0 | 75 ++++ usr/share/man/cat2/getdirentries.0 | 73 ++++ usr/share/man/cat2/getdtablesize.0 | 24 ++ usr/share/man/cat2/getegid.0 | 36 ++ usr/share/man/cat2/geteuid.0 | 36 ++ usr/share/man/cat2/getfh.0 | 49 +++ usr/share/man/cat2/getfsstat.0 | 77 ++++ usr/share/man/cat2/getgid.0 | 36 ++ usr/share/man/cat2/getgroups.0 | 43 ++ usr/share/man/cat2/gethostid.0 | 36 ++ usr/share/man/cat2/getitimer.0 | 81 ++++ usr/share/man/cat2/getlogin.0 | 66 +++ usr/share/man/cat2/getpeername.0 | 41 ++ usr/share/man/cat2/getpgrp.0 | 47 +++ usr/share/man/cat2/getpid.0 | 31 ++ usr/share/man/cat2/getppid.0 | 31 ++ usr/share/man/cat2/getpriority.0 | 58 +++ usr/share/man/cat2/getrlimit.0 | 113 +++++ usr/share/man/cat2/getrusage.0 | 116 ++++++ usr/share/man/cat2/getsockname.0 | 42 ++ usr/share/man/cat2/getsockopt.0 | 181 ++++++++ usr/share/man/cat2/gettimeofday.0 | 62 +++ usr/share/man/cat2/getuid.0 | 36 ++ usr/share/man/cat2/intro.0 | 550 +++++++++++++++++++++++++ usr/share/man/cat2/ioctl.0 | 45 ++ usr/share/man/cat2/kill.0 | 72 ++++ usr/share/man/cat2/killpg.0 | 48 +++ usr/share/man/cat2/ktrace.0 | 98 +++++ usr/share/man/cat2/link.0 | 88 ++++ usr/share/man/cat2/listen.0 | 47 +++ usr/share/man/cat2/lseek.0 | 58 +++ usr/share/man/cat2/lstat.0 | 157 +++++++ usr/share/man/cat2/madvise.0 | 27 ++ usr/share/man/cat2/mincore.0 | 21 + usr/share/man/cat2/mkdir.0 | 89 ++++ usr/share/man/cat2/mkfifo.0 | 85 ++++ usr/share/man/cat2/mknod.0 | 84 ++++ usr/share/man/cat2/mlock.0 | 87 ++++ usr/share/man/cat2/mmap.0 | 98 +++++ usr/share/man/cat2/mount.0 | 202 +++++++++ usr/share/man/cat2/mprotect.0 | 21 + usr/share/man/cat2/msync.0 | 24 ++ usr/share/man/cat2/munlock.0 | 87 ++++ usr/share/man/cat2/munmap.0 | 20 + usr/share/man/cat2/nfssvc.0 | 109 +++++ usr/share/man/cat2/open.0 | 152 +++++++ usr/share/man/cat2/pathconf.0 | 104 +++++ usr/share/man/cat2/pipe.0 | 52 +++ usr/share/man/cat2/profil.0 | 54 +++ usr/share/man/cat2/ptrace.0 | 264 ++++++++++++ usr/share/man/cat2/quotactl.0 | 119 ++++++ usr/share/man/cat2/read.0 | 94 +++++ usr/share/man/cat2/readlink.0 | 54 +++ usr/share/man/cat2/readv.0 | 94 +++++ usr/share/man/cat2/reboot.0 | 90 ++++ usr/share/man/cat2/recv.0 | 146 +++++++ usr/share/man/cat2/recvfrom.0 | 146 +++++++ usr/share/man/cat2/recvmsg.0 | 146 +++++++ usr/share/man/cat2/rename.0 | 110 +++++ usr/share/man/cat2/revoke.0 | 61 +++ usr/share/man/cat2/rmdir.0 | 66 +++ usr/share/man/cat2/sbrk.0 | 61 +++ usr/share/man/cat2/seek.0 | 58 +++ usr/share/man/cat2/select.0 | 94 +++++ usr/share/man/cat2/send.0 | 84 ++++ usr/share/man/cat2/sendmsg.0 | 84 ++++ usr/share/man/cat2/sendto.0 | 84 ++++ usr/share/man/cat2/setegid.0 | 57 +++ usr/share/man/cat2/seteuid.0 | 57 +++ usr/share/man/cat2/setgid.0 | 57 +++ usr/share/man/cat2/setgroups.0 | 43 ++ usr/share/man/cat2/sethostid.0 | 36 ++ usr/share/man/cat2/setitimer.0 | 81 ++++ usr/share/man/cat2/setlogin.0 | 66 +++ usr/share/man/cat2/setpriority.0 | 58 +++ usr/share/man/cat2/setregid.0 | 44 ++ usr/share/man/cat2/setreuid.0 | 41 ++ usr/share/man/cat2/setrgid.0 | 35 ++ usr/share/man/cat2/setrlimit.0 | 113 +++++ usr/share/man/cat2/setruid.0 | 35 ++ usr/share/man/cat2/setsid.0 | 37 ++ usr/share/man/cat2/setsockopt.0 | 181 ++++++++ usr/share/man/cat2/settimeofday.0 | 62 +++ usr/share/man/cat2/setuid.0 | 57 +++ usr/share/man/cat2/shutdown.0 | 36 ++ usr/share/man/cat2/sigaction.0 | 198 +++++++++ usr/share/man/cat2/sigaltstack.0 | 90 ++++ usr/share/man/cat2/sigblock.0 | 35 ++ usr/share/man/cat2/sigpause.0 | 28 ++ usr/share/man/cat2/sigpending.0 | 31 ++ usr/share/man/cat2/sigprocmask.0 | 55 +++ usr/share/man/cat2/sigreturn.0 | 54 +++ usr/share/man/cat2/sigsetmask.0 | 33 ++ usr/share/man/cat2/sigstack.0 | 16 + usr/share/man/cat2/sigsuspend.0 | 35 ++ usr/share/man/cat2/sigvec.0 | 185 +++++++++ usr/share/man/cat2/socket.0 | 132 ++++++ usr/share/man/cat2/socketpair.0 | 49 +++ usr/share/man/cat2/stat.0 | 157 +++++++ usr/share/man/cat2/statfs.0 | 93 +++++ usr/share/man/cat2/swapon.0 | 74 ++++ usr/share/man/cat2/symlink.0 | 87 ++++ usr/share/man/cat2/sync.0 | 31 ++ usr/share/man/cat2/syscall.0 | 37 ++ usr/share/man/cat2/truncate.0 | 75 ++++ usr/share/man/cat2/umask.0 | 36 ++ usr/share/man/cat2/unlink.0 | 71 ++++ usr/share/man/cat2/unmount.0 | 202 +++++++++ usr/share/man/cat2/utimes.0 | 70 ++++ usr/share/man/cat2/vfork.0 | 53 +++ usr/share/man/cat2/wait.0 | 150 +++++++ usr/share/man/cat2/wait3.0 | 150 +++++++ usr/share/man/cat2/wait4.0 | 150 +++++++ usr/share/man/cat2/waitpid.0 | 150 +++++++ usr/share/man/cat2/write.0 | 107 +++++ usr/share/man/cat2/writev.0 | 107 +++++ usr/share/man/cat3/_longjmp.0 | 79 ++++ usr/share/man/cat3/_setjmp.0 | 79 ++++ usr/share/man/cat3/abort.0 | 28 ++ usr/share/man/cat3/abs.0 | 27 ++ usr/share/man/cat3/addr.0 | 104 +++++ usr/share/man/cat3/alarm.0 | 30 ++ usr/share/man/cat3/alloca.0 | 26 ++ usr/share/man/cat3/alphasort.0 | 51 +++ usr/share/man/cat3/asctime.0 | 131 ++++++ usr/share/man/cat3/atexit.0 | 34 ++ usr/share/man/cat3/atof.0 | 36 ++ usr/share/man/cat3/atoi.0 | 26 ++ usr/share/man/cat3/atol.0 | 26 ++ usr/share/man/cat3/bcmp.0 | 25 ++ usr/share/man/cat3/bcopy.0 | 22 + usr/share/man/cat3/bsearch.0 | 37 ++ usr/share/man/cat3/bstring.0 | 55 +++ usr/share/man/cat3/btree.0 | 264 ++++++++++++ usr/share/man/cat3/byteorder.0 | 40 ++ usr/share/man/cat3/bzero.0 | 22 + usr/share/man/cat3/calloc.0 | 26 ++ usr/share/man/cat3/cfgetispeed.0 | 177 ++++++++ usr/share/man/cat3/cfgetospeed.0 | 177 ++++++++ usr/share/man/cat3/cfmakeraw.0 | 177 ++++++++ usr/share/man/cat3/cfsetispeed.0 | 177 ++++++++ usr/share/man/cat3/cfsetospeed.0 | 177 ++++++++ usr/share/man/cat3/cfsetspeed.0 | 177 ++++++++ usr/share/man/cat3/cgetcap.0 | 279 +++++++++++++ usr/share/man/cat3/cgetclose.0 | 279 +++++++++++++ usr/share/man/cat3/cgetent.0 | 279 +++++++++++++ usr/share/man/cat3/cgetfirst.0 | 279 +++++++++++++ usr/share/man/cat3/cgetmatch.0 | 279 +++++++++++++ usr/share/man/cat3/cgetnext.0 | 279 +++++++++++++ usr/share/man/cat3/cgetnum.0 | 279 +++++++++++++ usr/share/man/cat3/cgetset.0 | 279 +++++++++++++ usr/share/man/cat3/cgetstr.0 | 279 +++++++++++++ usr/share/man/cat3/cgetustr.0 | 279 +++++++++++++ usr/share/man/cat3/clearerr.0 | 47 +++ usr/share/man/cat3/clock.0 | 26 ++ usr/share/man/cat3/closedir.0 | 86 ++++ usr/share/man/cat3/closelog.0 | 150 +++++++ usr/share/man/cat3/confstr.0 | 53 +++ usr/share/man/cat3/crypt.0 | 106 +++++ usr/share/man/cat3/ctermid.0 | 42 ++ usr/share/man/cat3/ctime.0 | 131 ++++++ usr/share/man/cat3/ctype.0 | 58 +++ usr/share/man/cat3/daemon.0 | 29 ++ usr/share/man/cat3/db.0 | 462 +++++++++++++++++++++ usr/share/man/cat3/dbopen.0 | 462 +++++++++++++++++++++ usr/share/man/cat3/devname.0 | 25 ++ usr/share/man/cat3/difftime.0 | 131 ++++++ usr/share/man/cat3/directory.0 | 86 ++++ usr/share/man/cat3/dirfd.0 | 86 ++++ usr/share/man/cat3/div.0 | 23 ++ usr/share/man/cat3/dn_comp.0 | 138 +++++++ usr/share/man/cat3/dn_expand.0 | 138 +++++++ usr/share/man/cat3/encrypt.0 | 106 +++++ usr/share/man/cat3/endfsent.0 | 76 ++++ usr/share/man/cat3/endgrent.0 | 96 +++++ usr/share/man/cat3/endhostent.0 | 135 ++++++ usr/share/man/cat3/endnetent.0 | 81 ++++ usr/share/man/cat3/endnetgrent.0 | 64 +++ usr/share/man/cat3/endprotoent.0 | 75 ++++ usr/share/man/cat3/endpwent.0 | 112 +++++ usr/share/man/cat3/endservent.0 | 83 ++++ usr/share/man/cat3/endttyent.0 | 98 +++++ usr/share/man/cat3/endusershell.0 | 42 ++ usr/share/man/cat3/err.0 | 74 ++++ usr/share/man/cat3/errx.0 | 74 ++++ usr/share/man/cat3/exec.0 | 124 ++++++ usr/share/man/cat3/execl.0 | 124 ++++++ usr/share/man/cat3/execle.0 | 124 ++++++ usr/share/man/cat3/execlp.0 | 124 ++++++ usr/share/man/cat3/execv.0 | 124 ++++++ usr/share/man/cat3/execvp.0 | 124 ++++++ usr/share/man/cat3/exit.0 | 36 ++ usr/share/man/cat3/fclose.0 | 34 ++ usr/share/man/cat3/fdopen.0 | 98 +++++ usr/share/man/cat3/feof.0 | 47 +++ usr/share/man/cat3/ferror.0 | 47 +++ usr/share/man/cat3/fflush.0 | 45 ++ usr/share/man/cat3/ffs.0 | 23 ++ usr/share/man/cat3/fgetc.0 | 56 +++ usr/share/man/cat3/fgetline.0 | 48 +++ usr/share/man/cat3/fgetpos.0 | 75 ++++ usr/share/man/cat3/fgets.0 | 58 +++ usr/share/man/cat3/fileno.0 | 47 +++ usr/share/man/cat3/fnmatch.0 | 58 +++ usr/share/man/cat3/fopen.0 | 98 +++++ usr/share/man/cat3/fprintf.0 | 256 ++++++++++++ usr/share/man/cat3/fpurge.0 | 45 ++ usr/share/man/cat3/fputc.0 | 51 +++ usr/share/man/cat3/fputs.0 | 39 ++ usr/share/man/cat3/fread.0 | 41 ++ usr/share/man/cat3/free.0 | 29 ++ usr/share/man/cat3/freopen.0 | 98 +++++ usr/share/man/cat3/frexp.0 | 30 ++ usr/share/man/cat3/fropen.0 | 74 ++++ usr/share/man/cat3/fscanf.0 | 196 +++++++++ usr/share/man/cat3/fseek.0 | 75 ++++ usr/share/man/cat3/fsetpos.0 | 75 ++++ usr/share/man/cat3/ftell.0 | 75 ++++ usr/share/man/cat3/fts.0 | 374 +++++++++++++++++ usr/share/man/cat3/funopen.0 | 74 ++++ usr/share/man/cat3/fwopen.0 | 74 ++++ usr/share/man/cat3/fwrite.0 | 41 ++ usr/share/man/cat3/getbsize.0 | 33 ++ usr/share/man/cat3/getc.0 | 56 +++ usr/share/man/cat3/getcap.0 | 279 +++++++++++++ usr/share/man/cat3/getchar.0 | 56 +++ usr/share/man/cat3/getdiskbyname.0 | 24 ++ usr/share/man/cat3/getenv.0 | 64 +++ usr/share/man/cat3/getfsent.0 | 76 ++++ usr/share/man/cat3/getfsfile.0 | 76 ++++ usr/share/man/cat3/getfsspec.0 | 76 ++++ usr/share/man/cat3/getfstype.0 | 76 ++++ usr/share/man/cat3/getgrent.0 | 96 +++++ usr/share/man/cat3/getgrgid.0 | 96 +++++ usr/share/man/cat3/getgrnam.0 | 96 +++++ usr/share/man/cat3/getgrouplist.0 | 42 ++ usr/share/man/cat3/gethostbyaddr.0 | 135 ++++++ usr/share/man/cat3/gethostbyname.0 | 135 ++++++ usr/share/man/cat3/gethostent.0 | 135 ++++++ usr/share/man/cat3/gethostname.0 | 48 +++ usr/share/man/cat3/getloadavg.0 | 26 ++ usr/share/man/cat3/getmntinfo.0 | 47 +++ usr/share/man/cat3/getmode.0 | 39 ++ usr/share/man/cat3/getnetbyaddr.0 | 81 ++++ usr/share/man/cat3/getnetbyname.0 | 81 ++++ usr/share/man/cat3/getnetent.0 | 81 ++++ usr/share/man/cat3/getnetgrent.0 | 64 +++ usr/share/man/cat3/getopt.0 | 127 ++++++ usr/share/man/cat3/getpagesize.0 | 25 ++ usr/share/man/cat3/getpass.0 | 44 ++ usr/share/man/cat3/getprotobyname.0 | 75 ++++ usr/share/man/cat3/getprotobynumber.0 | 75 ++++ usr/share/man/cat3/getprotoent.0 | 75 ++++ usr/share/man/cat3/getpwent.0 | 112 +++++ usr/share/man/cat3/getpwnam.0 | 112 +++++ usr/share/man/cat3/getpwuid.0 | 112 +++++ usr/share/man/cat3/gets.0 | 58 +++ usr/share/man/cat3/getservbyname.0 | 83 ++++ usr/share/man/cat3/getservbyport.0 | 83 ++++ usr/share/man/cat3/getservent.0 | 83 ++++ usr/share/man/cat3/getsubopt.0 | 89 ++++ usr/share/man/cat3/getttyent.0 | 98 +++++ usr/share/man/cat3/getttynam.0 | 98 +++++ usr/share/man/cat3/getusershell.0 | 42 ++ usr/share/man/cat3/getw.0 | 56 +++ usr/share/man/cat3/glob.0 | 210 ++++++++++ usr/share/man/cat3/globfree.0 | 210 ++++++++++ usr/share/man/cat3/gmtime.0 | 131 ++++++ usr/share/man/cat3/group_from_gid.0 | 33 ++ usr/share/man/cat3/hash.0 | 132 ++++++ usr/share/man/cat3/heapsort.0 | 105 +++++ usr/share/man/cat3/herror.0 | 135 ++++++ usr/share/man/cat3/htonl.0 | 40 ++ usr/share/man/cat3/htons.0 | 40 ++ usr/share/man/cat3/index.0 | 27 ++ usr/share/man/cat3/inet.0 | 104 +++++ usr/share/man/cat3/inet_addr.0 | 104 +++++ usr/share/man/cat3/inet_aton.0 | 104 +++++ usr/share/man/cat3/inet_lnaof.0 | 104 +++++ usr/share/man/cat3/inet_makeaddr.0 | 104 +++++ usr/share/man/cat3/inet_netof.0 | 104 +++++ usr/share/man/cat3/inet_network.0 | 104 +++++ usr/share/man/cat3/inet_ntoa.0 | 104 +++++ usr/share/man/cat3/initgroups.0 | 34 ++ usr/share/man/cat3/initstate.0 | 89 ++++ usr/share/man/cat3/innetgr.0 | 64 +++ usr/share/man/cat3/isalnum.0 | 42 ++ usr/share/man/cat3/isalpha.0 | 40 ++ usr/share/man/cat3/isascii.0 | 22 + usr/share/man/cat3/isatty.0 | 58 +++ usr/share/man/cat3/isblank.0 | 22 + usr/share/man/cat3/iscntrl.0 | 35 ++ usr/share/man/cat3/isdigit.0 | 30 ++ usr/share/man/cat3/isgraph.0 | 47 +++ usr/share/man/cat3/isinf.0 | 29 ++ usr/share/man/cat3/islower.0 | 34 ++ usr/share/man/cat3/isnan.0 | 29 ++ usr/share/man/cat3/isprint.0 | 48 +++ usr/share/man/cat3/ispunct.0 | 36 ++ usr/share/man/cat3/isspace.0 | 30 ++ usr/share/man/cat3/isupper.0 | 34 ++ usr/share/man/cat3/isxdigit.0 | 33 ++ usr/share/man/cat3/labs.0 | 24 ++ usr/share/man/cat3/ldexp.0 | 29 ++ usr/share/man/cat3/ldiv.0 | 23 ++ usr/share/man/cat3/link_ntoa.0 | 57 +++ usr/share/man/cat3/localtime.0 | 131 ++++++ usr/share/man/cat3/longjmp.0 | 79 ++++ usr/share/man/cat3/longjmperr.0 | 79 ++++ usr/share/man/cat3/longjmperror.0 | 79 ++++ usr/share/man/cat3/malloc.0 | 40 ++ usr/share/man/cat3/mbrune.0 | 52 +++ usr/share/man/cat3/memccpy.0 | 25 ++ usr/share/man/cat3/memchr.0 | 27 ++ usr/share/man/cat3/memcmp.0 | 28 ++ usr/share/man/cat3/memcpy.0 | 30 ++ usr/share/man/cat3/memmove.0 | 26 ++ usr/share/man/cat3/memory.0 | 36 ++ usr/share/man/cat3/memset.0 | 25 ++ usr/share/man/cat3/mergesort.0 | 105 +++++ usr/share/man/cat3/mkstemp.0 | 55 +++ usr/share/man/cat3/mktemp.0 | 55 +++ usr/share/man/cat3/mktime.0 | 131 ++++++ usr/share/man/cat3/modf.0 | 27 ++ usr/share/man/cat3/moncontrol.0 | 41 ++ usr/share/man/cat3/monstartup.0 | 41 ++ usr/share/man/cat3/multibyte.0 | 108 +++++ usr/share/man/cat3/network.0 | 104 +++++ usr/share/man/cat3/nice.0 | 26 ++ usr/share/man/cat3/nlist.0 | 31 ++ usr/share/man/cat3/ns.0 | 59 +++ usr/share/man/cat3/ns_addr.0 | 59 +++ usr/share/man/cat3/ns_ntoa.0 | 59 +++ usr/share/man/cat3/ntoa.0 | 104 +++++ usr/share/man/cat3/ntohl.0 | 40 ++ usr/share/man/cat3/ntohs.0 | 40 ++ usr/share/man/cat3/opendir.0 | 86 ++++ usr/share/man/cat3/openlog.0 | 150 +++++++ usr/share/man/cat3/pause.0 | 34 ++ usr/share/man/cat3/pclose.0 | 73 ++++ usr/share/man/cat3/perror.0 | 52 +++ usr/share/man/cat3/popen.0 | 73 ++++ usr/share/man/cat3/printf.0 | 256 ++++++++++++ usr/share/man/cat3/psignal.0 | 37 ++ usr/share/man/cat3/putc.0 | 51 +++ usr/share/man/cat3/putchar.0 | 51 +++ usr/share/man/cat3/putenv.0 | 64 +++ usr/share/man/cat3/puts.0 | 39 ++ usr/share/man/cat3/putw.0 | 51 +++ usr/share/man/cat3/pwcache.0 | 33 ++ usr/share/man/cat3/qsort.0 | 105 +++++ usr/share/man/cat3/radixsort.0 | 66 +++ usr/share/man/cat3/raise.0 | 30 ++ usr/share/man/cat3/rand.0 | 35 ++ usr/share/man/cat3/random.0 | 89 ++++ usr/share/man/cat3/rcmd.0 | 96 +++++ usr/share/man/cat3/readdir.0 | 86 ++++ usr/share/man/cat3/realloc.0 | 35 ++ usr/share/man/cat3/recno.0 | 198 +++++++++ usr/share/man/cat3/regex.0 | 462 +++++++++++++++++++++ usr/share/man/cat3/regfree.0 | 462 +++++++++++++++++++++ usr/share/man/cat3/remove.0 | 30 ++ usr/share/man/cat3/res_init.0 | 138 +++++++ usr/share/man/cat3/res_mkquery.0 | 138 +++++++ usr/share/man/cat3/res_query.0 | 138 +++++++ usr/share/man/cat3/res_search.0 | 138 +++++++ usr/share/man/cat3/res_send.0 | 138 +++++++ usr/share/man/cat3/resolver.0 | 138 +++++++ usr/share/man/cat3/rewind.0 | 75 ++++ usr/share/man/cat3/rewinddir.0 | 86 ++++ usr/share/man/cat3/rindex.0 | 27 ++ usr/share/man/cat3/rresvport.0 | 96 +++++ usr/share/man/cat3/rune.0 | 116 ++++++ usr/share/man/cat3/ruserok.0 | 96 +++++ usr/share/man/cat3/scandir.0 | 51 +++ usr/share/man/cat3/scanf.0 | 196 +++++++++ usr/share/man/cat3/seekdir.0 | 86 ++++ usr/share/man/cat3/setbuf.0 | 91 +++++ usr/share/man/cat3/setbuffer.0 | 91 +++++ usr/share/man/cat3/setenv.0 | 64 +++ usr/share/man/cat3/setfsent.0 | 76 ++++ usr/share/man/cat3/setgrent.0 | 96 +++++ usr/share/man/cat3/setgrfile.0 | 96 +++++ usr/share/man/cat3/setgroupent.0 | 96 +++++ usr/share/man/cat3/sethostent.0 | 135 ++++++ usr/share/man/cat3/sethostname.0 | 48 +++ usr/share/man/cat3/setjmp.0 | 79 ++++ usr/share/man/cat3/setkey.0 | 106 +++++ usr/share/man/cat3/setlinebuf.0 | 91 +++++ usr/share/man/cat3/setlocale.0 | 179 ++++++++ usr/share/man/cat3/setlogmask.0 | 150 +++++++ usr/share/man/cat3/setmode.0 | 39 ++ usr/share/man/cat3/setnetent.0 | 81 ++++ usr/share/man/cat3/setnetgrent.0 | 64 +++ usr/share/man/cat3/setpassent.0 | 112 +++++ usr/share/man/cat3/setprotoent.0 | 75 ++++ usr/share/man/cat3/setpwent.0 | 112 +++++ usr/share/man/cat3/setpwfile.0 | 112 +++++ usr/share/man/cat3/setservent.0 | 83 ++++ usr/share/man/cat3/setstate.0 | 89 ++++ usr/share/man/cat3/setttyent.0 | 98 +++++ usr/share/man/cat3/setusershell.0 | 42 ++ usr/share/man/cat3/setvbuf.0 | 91 +++++ usr/share/man/cat3/sigaddset.0 | 56 +++ usr/share/man/cat3/sigdelset.0 | 56 +++ usr/share/man/cat3/sigemptyset.0 | 56 +++ usr/share/man/cat3/sigfillset.0 | 56 +++ usr/share/man/cat3/siginterrupt.0 | 52 +++ usr/share/man/cat3/sigismember.0 | 56 +++ usr/share/man/cat3/siglongjmp.0 | 79 ++++ usr/share/man/cat3/signal.0 | 129 ++++++ usr/share/man/cat3/sigsetjmp.0 | 79 ++++ usr/share/man/cat3/sigsetops.0 | 56 +++ usr/share/man/cat3/sleep.0 | 35 ++ usr/share/man/cat3/snprintf.0 | 256 ++++++++++++ usr/share/man/cat3/sprintf.0 | 256 ++++++++++++ usr/share/man/cat3/srand.0 | 35 ++ usr/share/man/cat3/srandom.0 | 89 ++++ usr/share/man/cat3/sscanf.0 | 196 +++++++++ usr/share/man/cat3/stdio.0 | 150 +++++++ usr/share/man/cat3/strcasecmp.0 | 31 ++ usr/share/man/cat3/strcat.0 | 33 ++ usr/share/man/cat3/strchr.0 | 28 ++ usr/share/man/cat3/strcmp.0 | 34 ++ usr/share/man/cat3/strcoll.0 | 25 ++ usr/share/man/cat3/strcpy.0 | 42 ++ usr/share/man/cat3/strcspn.0 | 27 ++ usr/share/man/cat3/strdup.0 | 25 ++ usr/share/man/cat3/strerror.0 | 52 +++ usr/share/man/cat3/strftime.0 | 123 ++++++ usr/share/man/cat3/string.0 | 95 +++++ usr/share/man/cat3/strlen.0 | 25 ++ usr/share/man/cat3/strmode.0 | 90 ++++ usr/share/man/cat3/strncasecmp.0 | 31 ++ usr/share/man/cat3/strncat.0 | 33 ++ usr/share/man/cat3/strncmp.0 | 34 ++ usr/share/man/cat3/strncpy.0 | 42 ++ usr/share/man/cat3/strpbrk.0 | 25 ++ usr/share/man/cat3/strrchr.0 | 28 ++ usr/share/man/cat3/strsep.0 | 44 ++ usr/share/man/cat3/strspn.0 | 26 ++ usr/share/man/cat3/strstr.0 | 26 ++ usr/share/man/cat3/strtod.0 | 69 ++++ usr/share/man/cat3/strtok.0 | 43 ++ usr/share/man/cat3/strtol.0 | 64 +++ usr/share/man/cat3/strtoq.0 | 64 +++ usr/share/man/cat3/strtoul.0 | 65 +++ usr/share/man/cat3/strtouq.0 | 65 +++ usr/share/man/cat3/strxfrm.0 | 22 + usr/share/man/cat3/swab.0 | 24 ++ usr/share/man/cat3/sys_siglist.0 | 37 ++ usr/share/man/cat3/sysconf.0 | 151 +++++++ usr/share/man/cat3/sysctl.0 | 568 ++++++++++++++++++++++++++ usr/share/man/cat3/syslog.0 | 150 +++++++ usr/share/man/cat3/system.0 | 30 ++ usr/share/man/cat3/tcdrain.0 | 81 ++++ usr/share/man/cat3/tcflow.0 | 81 ++++ usr/share/man/cat3/tcflush.0 | 81 ++++ usr/share/man/cat3/tcgetattr.0 | 177 ++++++++ usr/share/man/cat3/tcgetpgrp.0 | 35 ++ usr/share/man/cat3/tcsendbreak.0 | 81 ++++ usr/share/man/cat3/tcsetattr.0 | 177 ++++++++ usr/share/man/cat3/tcsetpgrp.0 | 47 +++ usr/share/man/cat3/telldir.0 | 86 ++++ usr/share/man/cat3/tempnam.0 | 95 +++++ usr/share/man/cat3/time.0 | 34 ++ usr/share/man/cat3/times.0 | 63 +++ usr/share/man/cat3/timezone.0 | 24 ++ usr/share/man/cat3/tmpfile.0 | 95 +++++ usr/share/man/cat3/tmpnam.0 | 95 +++++ usr/share/man/cat3/toascii.0 | 24 ++ usr/share/man/cat3/tolower.0 | 29 ++ usr/share/man/cat3/toupper.0 | 26 ++ usr/share/man/cat3/ttyname.0 | 58 +++ usr/share/man/cat3/ttyslot.0 | 58 +++ usr/share/man/cat3/tzset.0 | 144 +++++++ usr/share/man/cat3/tzsetwall.0 | 144 +++++++ usr/share/man/cat3/ualarm.0 | 35 ++ usr/share/man/cat3/ungetc.0 | 38 ++ usr/share/man/cat3/unsetenv.0 | 64 +++ usr/share/man/cat3/unvis.0 | 92 +++++ usr/share/man/cat3/user_from_uid.0 | 33 ++ usr/share/man/cat3/usleep.0 | 35 ++ usr/share/man/cat3/utime.0 | 39 ++ usr/share/man/cat3/valloc.0 | 31 ++ usr/share/man/cat3/verr.0 | 74 ++++ usr/share/man/cat3/verrx.0 | 74 ++++ usr/share/man/cat3/vfprintf.0 | 256 ++++++++++++ usr/share/man/cat3/vfscanf.0 | 196 +++++++++ usr/share/man/cat3/vis.0 | 120 ++++++ usr/share/man/cat3/vprintf.0 | 256 ++++++++++++ usr/share/man/cat3/vscanf.0 | 196 +++++++++ usr/share/man/cat3/vsnprintf.0 | 256 ++++++++++++ usr/share/man/cat3/vsprintf.0 | 256 ++++++++++++ usr/share/man/cat3/vsscanf.0 | 196 +++++++++ usr/share/man/cat3/vsyslog.0 | 150 +++++++ usr/share/man/cat3/vwarn.0 | 74 ++++ usr/share/man/cat3/vwarnx.0 | 74 ++++ usr/share/man/cat3/warn.0 | 74 ++++ usr/share/man/cat3/warnx.0 | 74 ++++ usr/share/man/cat3/zopen.0 | 56 +++ usr/share/man/cat4/euc.0 | 158 +++++++ usr/share/man/cat4/utf2.0 | 46 +++ usr/share/man/cat7/re_format.0 | 330 +++++++++++++++ usr/src/Domestic/man/crypt.0.3 | 106 +++++ 536 files changed, 48090 insertions(+) create mode 100644 usr/share/man/cat2/__syscall.0 create mode 100644 usr/share/man/cat2/_exit.0 create mode 100644 usr/share/man/cat2/accept.0 create mode 100644 usr/share/man/cat2/access.0 create mode 100644 usr/share/man/cat2/acct.0 create mode 100644 usr/share/man/cat2/adjtime.0 create mode 100644 usr/share/man/cat2/bind.0 create mode 100644 usr/share/man/cat2/brk.0 create mode 100644 usr/share/man/cat2/chdir.0 create mode 100644 usr/share/man/cat2/chflags.0 create mode 100644 usr/share/man/cat2/chmod.0 create mode 100644 usr/share/man/cat2/chown.0 create mode 100644 usr/share/man/cat2/chroot.0 create mode 100644 usr/share/man/cat2/close.0 create mode 100644 usr/share/man/cat2/connect.0 create mode 100644 usr/share/man/cat2/creat.0 create mode 100644 usr/share/man/cat2/dup.0 create mode 100644 usr/share/man/cat2/dup2.0 create mode 100644 usr/share/man/cat2/errno.0 create mode 100644 usr/share/man/cat2/execve.0 create mode 100644 usr/share/man/cat2/fchdir.0 create mode 100644 usr/share/man/cat2/fchflags.0 create mode 100644 usr/share/man/cat2/fchmod.0 create mode 100644 usr/share/man/cat2/fchown.0 create mode 100644 usr/share/man/cat2/fcntl.0 create mode 100644 usr/share/man/cat2/flock.0 create mode 100644 usr/share/man/cat2/fork.0 create mode 100644 usr/share/man/cat2/fpathconf.0 create mode 100644 usr/share/man/cat2/fstat.0 create mode 100644 usr/share/man/cat2/fstatfs.0 create mode 100644 usr/share/man/cat2/fsync.0 create mode 100644 usr/share/man/cat2/ftruncate.0 create mode 100644 usr/share/man/cat2/getdirentries.0 create mode 100644 usr/share/man/cat2/getdtablesize.0 create mode 100644 usr/share/man/cat2/getegid.0 create mode 100644 usr/share/man/cat2/geteuid.0 create mode 100644 usr/share/man/cat2/getfh.0 create mode 100644 usr/share/man/cat2/getfsstat.0 create mode 100644 usr/share/man/cat2/getgid.0 create mode 100644 usr/share/man/cat2/getgroups.0 create mode 100644 usr/share/man/cat2/gethostid.0 create mode 100644 usr/share/man/cat2/getitimer.0 create mode 100644 usr/share/man/cat2/getlogin.0 create mode 100644 usr/share/man/cat2/getpeername.0 create mode 100644 usr/share/man/cat2/getpgrp.0 create mode 100644 usr/share/man/cat2/getpid.0 create mode 100644 usr/share/man/cat2/getppid.0 create mode 100644 usr/share/man/cat2/getpriority.0 create mode 100644 usr/share/man/cat2/getrlimit.0 create mode 100644 usr/share/man/cat2/getrusage.0 create mode 100644 usr/share/man/cat2/getsockname.0 create mode 100644 usr/share/man/cat2/getsockopt.0 create mode 100644 usr/share/man/cat2/gettimeofday.0 create mode 100644 usr/share/man/cat2/getuid.0 create mode 100644 usr/share/man/cat2/intro.0 create mode 100644 usr/share/man/cat2/ioctl.0 create mode 100644 usr/share/man/cat2/kill.0 create mode 100644 usr/share/man/cat2/killpg.0 create mode 100644 usr/share/man/cat2/ktrace.0 create mode 100644 usr/share/man/cat2/link.0 create mode 100644 usr/share/man/cat2/listen.0 create mode 100644 usr/share/man/cat2/lseek.0 create mode 100644 usr/share/man/cat2/lstat.0 create mode 100644 usr/share/man/cat2/madvise.0 create mode 100644 usr/share/man/cat2/mincore.0 create mode 100644 usr/share/man/cat2/mkdir.0 create mode 100644 usr/share/man/cat2/mkfifo.0 create mode 100644 usr/share/man/cat2/mknod.0 create mode 100644 usr/share/man/cat2/mlock.0 create mode 100644 usr/share/man/cat2/mmap.0 create mode 100644 usr/share/man/cat2/mount.0 create mode 100644 usr/share/man/cat2/mprotect.0 create mode 100644 usr/share/man/cat2/msync.0 create mode 100644 usr/share/man/cat2/munlock.0 create mode 100644 usr/share/man/cat2/munmap.0 create mode 100644 usr/share/man/cat2/nfssvc.0 create mode 100644 usr/share/man/cat2/open.0 create mode 100644 usr/share/man/cat2/pathconf.0 create mode 100644 usr/share/man/cat2/pipe.0 create mode 100644 usr/share/man/cat2/profil.0 create mode 100644 usr/share/man/cat2/ptrace.0 create mode 100644 usr/share/man/cat2/quotactl.0 create mode 100644 usr/share/man/cat2/read.0 create mode 100644 usr/share/man/cat2/readlink.0 create mode 100644 usr/share/man/cat2/readv.0 create mode 100644 usr/share/man/cat2/reboot.0 create mode 100644 usr/share/man/cat2/recv.0 create mode 100644 usr/share/man/cat2/recvfrom.0 create mode 100644 usr/share/man/cat2/recvmsg.0 create mode 100644 usr/share/man/cat2/rename.0 create mode 100644 usr/share/man/cat2/revoke.0 create mode 100644 usr/share/man/cat2/rmdir.0 create mode 100644 usr/share/man/cat2/sbrk.0 create mode 100644 usr/share/man/cat2/seek.0 create mode 100644 usr/share/man/cat2/select.0 create mode 100644 usr/share/man/cat2/send.0 create mode 100644 usr/share/man/cat2/sendmsg.0 create mode 100644 usr/share/man/cat2/sendto.0 create mode 100644 usr/share/man/cat2/setegid.0 create mode 100644 usr/share/man/cat2/seteuid.0 create mode 100644 usr/share/man/cat2/setgid.0 create mode 100644 usr/share/man/cat2/setgroups.0 create mode 100644 usr/share/man/cat2/sethostid.0 create mode 100644 usr/share/man/cat2/setitimer.0 create mode 100644 usr/share/man/cat2/setlogin.0 create mode 100644 usr/share/man/cat2/setpriority.0 create mode 100644 usr/share/man/cat2/setregid.0 create mode 100644 usr/share/man/cat2/setreuid.0 create mode 100644 usr/share/man/cat2/setrgid.0 create mode 100644 usr/share/man/cat2/setrlimit.0 create mode 100644 usr/share/man/cat2/setruid.0 create mode 100644 usr/share/man/cat2/setsid.0 create mode 100644 usr/share/man/cat2/setsockopt.0 create mode 100644 usr/share/man/cat2/settimeofday.0 create mode 100644 usr/share/man/cat2/setuid.0 create mode 100644 usr/share/man/cat2/shutdown.0 create mode 100644 usr/share/man/cat2/sigaction.0 create mode 100644 usr/share/man/cat2/sigaltstack.0 create mode 100644 usr/share/man/cat2/sigblock.0 create mode 100644 usr/share/man/cat2/sigpause.0 create mode 100644 usr/share/man/cat2/sigpending.0 create mode 100644 usr/share/man/cat2/sigprocmask.0 create mode 100644 usr/share/man/cat2/sigreturn.0 create mode 100644 usr/share/man/cat2/sigsetmask.0 create mode 100644 usr/share/man/cat2/sigstack.0 create mode 100644 usr/share/man/cat2/sigsuspend.0 create mode 100644 usr/share/man/cat2/sigvec.0 create mode 100644 usr/share/man/cat2/socket.0 create mode 100644 usr/share/man/cat2/socketpair.0 create mode 100644 usr/share/man/cat2/stat.0 create mode 100644 usr/share/man/cat2/statfs.0 create mode 100644 usr/share/man/cat2/swapon.0 create mode 100644 usr/share/man/cat2/symlink.0 create mode 100644 usr/share/man/cat2/sync.0 create mode 100644 usr/share/man/cat2/syscall.0 create mode 100644 usr/share/man/cat2/truncate.0 create mode 100644 usr/share/man/cat2/umask.0 create mode 100644 usr/share/man/cat2/unlink.0 create mode 100644 usr/share/man/cat2/unmount.0 create mode 100644 usr/share/man/cat2/utimes.0 create mode 100644 usr/share/man/cat2/vfork.0 create mode 100644 usr/share/man/cat2/wait.0 create mode 100644 usr/share/man/cat2/wait3.0 create mode 100644 usr/share/man/cat2/wait4.0 create mode 100644 usr/share/man/cat2/waitpid.0 create mode 100644 usr/share/man/cat2/write.0 create mode 100644 usr/share/man/cat2/writev.0 create mode 100644 usr/share/man/cat3/_longjmp.0 create mode 100644 usr/share/man/cat3/_setjmp.0 create mode 100644 usr/share/man/cat3/abort.0 create mode 100644 usr/share/man/cat3/abs.0 create mode 100644 usr/share/man/cat3/addr.0 create mode 100644 usr/share/man/cat3/alarm.0 create mode 100644 usr/share/man/cat3/alloca.0 create mode 100644 usr/share/man/cat3/alphasort.0 create mode 100644 usr/share/man/cat3/asctime.0 create mode 100644 usr/share/man/cat3/atexit.0 create mode 100644 usr/share/man/cat3/atof.0 create mode 100644 usr/share/man/cat3/atoi.0 create mode 100644 usr/share/man/cat3/atol.0 create mode 100644 usr/share/man/cat3/bcmp.0 create mode 100644 usr/share/man/cat3/bcopy.0 create mode 100644 usr/share/man/cat3/bsearch.0 create mode 100644 usr/share/man/cat3/bstring.0 create mode 100644 usr/share/man/cat3/btree.0 create mode 100644 usr/share/man/cat3/byteorder.0 create mode 100644 usr/share/man/cat3/bzero.0 create mode 100644 usr/share/man/cat3/calloc.0 create mode 100644 usr/share/man/cat3/cfgetispeed.0 create mode 100644 usr/share/man/cat3/cfgetospeed.0 create mode 100644 usr/share/man/cat3/cfmakeraw.0 create mode 100644 usr/share/man/cat3/cfsetispeed.0 create mode 100644 usr/share/man/cat3/cfsetospeed.0 create mode 100644 usr/share/man/cat3/cfsetspeed.0 create mode 100644 usr/share/man/cat3/cgetcap.0 create mode 100644 usr/share/man/cat3/cgetclose.0 create mode 100644 usr/share/man/cat3/cgetent.0 create mode 100644 usr/share/man/cat3/cgetfirst.0 create mode 100644 usr/share/man/cat3/cgetmatch.0 create mode 100644 usr/share/man/cat3/cgetnext.0 create mode 100644 usr/share/man/cat3/cgetnum.0 create mode 100644 usr/share/man/cat3/cgetset.0 create mode 100644 usr/share/man/cat3/cgetstr.0 create mode 100644 usr/share/man/cat3/cgetustr.0 create mode 100644 usr/share/man/cat3/clearerr.0 create mode 100644 usr/share/man/cat3/clock.0 create mode 100644 usr/share/man/cat3/closedir.0 create mode 100644 usr/share/man/cat3/closelog.0 create mode 100644 usr/share/man/cat3/confstr.0 create mode 100644 usr/share/man/cat3/crypt.0 create mode 100644 usr/share/man/cat3/ctermid.0 create mode 100644 usr/share/man/cat3/ctime.0 create mode 100644 usr/share/man/cat3/ctype.0 create mode 100644 usr/share/man/cat3/daemon.0 create mode 100644 usr/share/man/cat3/db.0 create mode 100644 usr/share/man/cat3/dbopen.0 create mode 100644 usr/share/man/cat3/devname.0 create mode 100644 usr/share/man/cat3/difftime.0 create mode 100644 usr/share/man/cat3/directory.0 create mode 100644 usr/share/man/cat3/dirfd.0 create mode 100644 usr/share/man/cat3/div.0 create mode 100644 usr/share/man/cat3/dn_comp.0 create mode 100644 usr/share/man/cat3/dn_expand.0 create mode 100644 usr/share/man/cat3/encrypt.0 create mode 100644 usr/share/man/cat3/endfsent.0 create mode 100644 usr/share/man/cat3/endgrent.0 create mode 100644 usr/share/man/cat3/endhostent.0 create mode 100644 usr/share/man/cat3/endnetent.0 create mode 100644 usr/share/man/cat3/endnetgrent.0 create mode 100644 usr/share/man/cat3/endprotoent.0 create mode 100644 usr/share/man/cat3/endpwent.0 create mode 100644 usr/share/man/cat3/endservent.0 create mode 100644 usr/share/man/cat3/endttyent.0 create mode 100644 usr/share/man/cat3/endusershell.0 create mode 100644 usr/share/man/cat3/err.0 create mode 100644 usr/share/man/cat3/errx.0 create mode 100644 usr/share/man/cat3/exec.0 create mode 100644 usr/share/man/cat3/execl.0 create mode 100644 usr/share/man/cat3/execle.0 create mode 100644 usr/share/man/cat3/execlp.0 create mode 100644 usr/share/man/cat3/execv.0 create mode 100644 usr/share/man/cat3/execvp.0 create mode 100644 usr/share/man/cat3/exit.0 create mode 100644 usr/share/man/cat3/fclose.0 create mode 100644 usr/share/man/cat3/fdopen.0 create mode 100644 usr/share/man/cat3/feof.0 create mode 100644 usr/share/man/cat3/ferror.0 create mode 100644 usr/share/man/cat3/fflush.0 create mode 100644 usr/share/man/cat3/ffs.0 create mode 100644 usr/share/man/cat3/fgetc.0 create mode 100644 usr/share/man/cat3/fgetline.0 create mode 100644 usr/share/man/cat3/fgetpos.0 create mode 100644 usr/share/man/cat3/fgets.0 create mode 100644 usr/share/man/cat3/fileno.0 create mode 100644 usr/share/man/cat3/fnmatch.0 create mode 100644 usr/share/man/cat3/fopen.0 create mode 100644 usr/share/man/cat3/fprintf.0 create mode 100644 usr/share/man/cat3/fpurge.0 create mode 100644 usr/share/man/cat3/fputc.0 create mode 100644 usr/share/man/cat3/fputs.0 create mode 100644 usr/share/man/cat3/fread.0 create mode 100644 usr/share/man/cat3/free.0 create mode 100644 usr/share/man/cat3/freopen.0 create mode 100644 usr/share/man/cat3/frexp.0 create mode 100644 usr/share/man/cat3/fropen.0 create mode 100644 usr/share/man/cat3/fscanf.0 create mode 100644 usr/share/man/cat3/fseek.0 create mode 100644 usr/share/man/cat3/fsetpos.0 create mode 100644 usr/share/man/cat3/ftell.0 create mode 100644 usr/share/man/cat3/fts.0 create mode 100644 usr/share/man/cat3/funopen.0 create mode 100644 usr/share/man/cat3/fwopen.0 create mode 100644 usr/share/man/cat3/fwrite.0 create mode 100644 usr/share/man/cat3/getbsize.0 create mode 100644 usr/share/man/cat3/getc.0 create mode 100644 usr/share/man/cat3/getcap.0 create mode 100644 usr/share/man/cat3/getchar.0 create mode 100644 usr/share/man/cat3/getdiskbyname.0 create mode 100644 usr/share/man/cat3/getenv.0 create mode 100644 usr/share/man/cat3/getfsent.0 create mode 100644 usr/share/man/cat3/getfsfile.0 create mode 100644 usr/share/man/cat3/getfsspec.0 create mode 100644 usr/share/man/cat3/getfstype.0 create mode 100644 usr/share/man/cat3/getgrent.0 create mode 100644 usr/share/man/cat3/getgrgid.0 create mode 100644 usr/share/man/cat3/getgrnam.0 create mode 100644 usr/share/man/cat3/getgrouplist.0 create mode 100644 usr/share/man/cat3/gethostbyaddr.0 create mode 100644 usr/share/man/cat3/gethostbyname.0 create mode 100644 usr/share/man/cat3/gethostent.0 create mode 100644 usr/share/man/cat3/gethostname.0 create mode 100644 usr/share/man/cat3/getloadavg.0 create mode 100644 usr/share/man/cat3/getmntinfo.0 create mode 100644 usr/share/man/cat3/getmode.0 create mode 100644 usr/share/man/cat3/getnetbyaddr.0 create mode 100644 usr/share/man/cat3/getnetbyname.0 create mode 100644 usr/share/man/cat3/getnetent.0 create mode 100644 usr/share/man/cat3/getnetgrent.0 create mode 100644 usr/share/man/cat3/getopt.0 create mode 100644 usr/share/man/cat3/getpagesize.0 create mode 100644 usr/share/man/cat3/getpass.0 create mode 100644 usr/share/man/cat3/getprotobyname.0 create mode 100644 usr/share/man/cat3/getprotobynumber.0 create mode 100644 usr/share/man/cat3/getprotoent.0 create mode 100644 usr/share/man/cat3/getpwent.0 create mode 100644 usr/share/man/cat3/getpwnam.0 create mode 100644 usr/share/man/cat3/getpwuid.0 create mode 100644 usr/share/man/cat3/gets.0 create mode 100644 usr/share/man/cat3/getservbyname.0 create mode 100644 usr/share/man/cat3/getservbyport.0 create mode 100644 usr/share/man/cat3/getservent.0 create mode 100644 usr/share/man/cat3/getsubopt.0 create mode 100644 usr/share/man/cat3/getttyent.0 create mode 100644 usr/share/man/cat3/getttynam.0 create mode 100644 usr/share/man/cat3/getusershell.0 create mode 100644 usr/share/man/cat3/getw.0 create mode 100644 usr/share/man/cat3/glob.0 create mode 100644 usr/share/man/cat3/globfree.0 create mode 100644 usr/share/man/cat3/gmtime.0 create mode 100644 usr/share/man/cat3/group_from_gid.0 create mode 100644 usr/share/man/cat3/hash.0 create mode 100644 usr/share/man/cat3/heapsort.0 create mode 100644 usr/share/man/cat3/herror.0 create mode 100644 usr/share/man/cat3/htonl.0 create mode 100644 usr/share/man/cat3/htons.0 create mode 100644 usr/share/man/cat3/index.0 create mode 100644 usr/share/man/cat3/inet.0 create mode 100644 usr/share/man/cat3/inet_addr.0 create mode 100644 usr/share/man/cat3/inet_aton.0 create mode 100644 usr/share/man/cat3/inet_lnaof.0 create mode 100644 usr/share/man/cat3/inet_makeaddr.0 create mode 100644 usr/share/man/cat3/inet_netof.0 create mode 100644 usr/share/man/cat3/inet_network.0 create mode 100644 usr/share/man/cat3/inet_ntoa.0 create mode 100644 usr/share/man/cat3/initgroups.0 create mode 100644 usr/share/man/cat3/initstate.0 create mode 100644 usr/share/man/cat3/innetgr.0 create mode 100644 usr/share/man/cat3/isalnum.0 create mode 100644 usr/share/man/cat3/isalpha.0 create mode 100644 usr/share/man/cat3/isascii.0 create mode 100644 usr/share/man/cat3/isatty.0 create mode 100644 usr/share/man/cat3/isblank.0 create mode 100644 usr/share/man/cat3/iscntrl.0 create mode 100644 usr/share/man/cat3/isdigit.0 create mode 100644 usr/share/man/cat3/isgraph.0 create mode 100644 usr/share/man/cat3/isinf.0 create mode 100644 usr/share/man/cat3/islower.0 create mode 100644 usr/share/man/cat3/isnan.0 create mode 100644 usr/share/man/cat3/isprint.0 create mode 100644 usr/share/man/cat3/ispunct.0 create mode 100644 usr/share/man/cat3/isspace.0 create mode 100644 usr/share/man/cat3/isupper.0 create mode 100644 usr/share/man/cat3/isxdigit.0 create mode 100644 usr/share/man/cat3/labs.0 create mode 100644 usr/share/man/cat3/ldexp.0 create mode 100644 usr/share/man/cat3/ldiv.0 create mode 100644 usr/share/man/cat3/link_ntoa.0 create mode 100644 usr/share/man/cat3/localtime.0 create mode 100644 usr/share/man/cat3/longjmp.0 create mode 100644 usr/share/man/cat3/longjmperr.0 create mode 100644 usr/share/man/cat3/longjmperror.0 create mode 100644 usr/share/man/cat3/malloc.0 create mode 100644 usr/share/man/cat3/mbrune.0 create mode 100644 usr/share/man/cat3/memccpy.0 create mode 100644 usr/share/man/cat3/memchr.0 create mode 100644 usr/share/man/cat3/memcmp.0 create mode 100644 usr/share/man/cat3/memcpy.0 create mode 100644 usr/share/man/cat3/memmove.0 create mode 100644 usr/share/man/cat3/memory.0 create mode 100644 usr/share/man/cat3/memset.0 create mode 100644 usr/share/man/cat3/mergesort.0 create mode 100644 usr/share/man/cat3/mkstemp.0 create mode 100644 usr/share/man/cat3/mktemp.0 create mode 100644 usr/share/man/cat3/mktime.0 create mode 100644 usr/share/man/cat3/modf.0 create mode 100644 usr/share/man/cat3/moncontrol.0 create mode 100644 usr/share/man/cat3/monstartup.0 create mode 100644 usr/share/man/cat3/multibyte.0 create mode 100644 usr/share/man/cat3/network.0 create mode 100644 usr/share/man/cat3/nice.0 create mode 100644 usr/share/man/cat3/nlist.0 create mode 100644 usr/share/man/cat3/ns.0 create mode 100644 usr/share/man/cat3/ns_addr.0 create mode 100644 usr/share/man/cat3/ns_ntoa.0 create mode 100644 usr/share/man/cat3/ntoa.0 create mode 100644 usr/share/man/cat3/ntohl.0 create mode 100644 usr/share/man/cat3/ntohs.0 create mode 100644 usr/share/man/cat3/opendir.0 create mode 100644 usr/share/man/cat3/openlog.0 create mode 100644 usr/share/man/cat3/pause.0 create mode 100644 usr/share/man/cat3/pclose.0 create mode 100644 usr/share/man/cat3/perror.0 create mode 100644 usr/share/man/cat3/popen.0 create mode 100644 usr/share/man/cat3/printf.0 create mode 100644 usr/share/man/cat3/psignal.0 create mode 100644 usr/share/man/cat3/putc.0 create mode 100644 usr/share/man/cat3/putchar.0 create mode 100644 usr/share/man/cat3/putenv.0 create mode 100644 usr/share/man/cat3/puts.0 create mode 100644 usr/share/man/cat3/putw.0 create mode 100644 usr/share/man/cat3/pwcache.0 create mode 100644 usr/share/man/cat3/qsort.0 create mode 100644 usr/share/man/cat3/radixsort.0 create mode 100644 usr/share/man/cat3/raise.0 create mode 100644 usr/share/man/cat3/rand.0 create mode 100644 usr/share/man/cat3/random.0 create mode 100644 usr/share/man/cat3/rcmd.0 create mode 100644 usr/share/man/cat3/readdir.0 create mode 100644 usr/share/man/cat3/realloc.0 create mode 100644 usr/share/man/cat3/recno.0 create mode 100644 usr/share/man/cat3/regex.0 create mode 100644 usr/share/man/cat3/regfree.0 create mode 100644 usr/share/man/cat3/remove.0 create mode 100644 usr/share/man/cat3/res_init.0 create mode 100644 usr/share/man/cat3/res_mkquery.0 create mode 100644 usr/share/man/cat3/res_query.0 create mode 100644 usr/share/man/cat3/res_search.0 create mode 100644 usr/share/man/cat3/res_send.0 create mode 100644 usr/share/man/cat3/resolver.0 create mode 100644 usr/share/man/cat3/rewind.0 create mode 100644 usr/share/man/cat3/rewinddir.0 create mode 100644 usr/share/man/cat3/rindex.0 create mode 100644 usr/share/man/cat3/rresvport.0 create mode 100644 usr/share/man/cat3/rune.0 create mode 100644 usr/share/man/cat3/ruserok.0 create mode 100644 usr/share/man/cat3/scandir.0 create mode 100644 usr/share/man/cat3/scanf.0 create mode 100644 usr/share/man/cat3/seekdir.0 create mode 100644 usr/share/man/cat3/setbuf.0 create mode 100644 usr/share/man/cat3/setbuffer.0 create mode 100644 usr/share/man/cat3/setenv.0 create mode 100644 usr/share/man/cat3/setfsent.0 create mode 100644 usr/share/man/cat3/setgrent.0 create mode 100644 usr/share/man/cat3/setgrfile.0 create mode 100644 usr/share/man/cat3/setgroupent.0 create mode 100644 usr/share/man/cat3/sethostent.0 create mode 100644 usr/share/man/cat3/sethostname.0 create mode 100644 usr/share/man/cat3/setjmp.0 create mode 100644 usr/share/man/cat3/setkey.0 create mode 100644 usr/share/man/cat3/setlinebuf.0 create mode 100644 usr/share/man/cat3/setlocale.0 create mode 100644 usr/share/man/cat3/setlogmask.0 create mode 100644 usr/share/man/cat3/setmode.0 create mode 100644 usr/share/man/cat3/setnetent.0 create mode 100644 usr/share/man/cat3/setnetgrent.0 create mode 100644 usr/share/man/cat3/setpassent.0 create mode 100644 usr/share/man/cat3/setprotoent.0 create mode 100644 usr/share/man/cat3/setpwent.0 create mode 100644 usr/share/man/cat3/setpwfile.0 create mode 100644 usr/share/man/cat3/setservent.0 create mode 100644 usr/share/man/cat3/setstate.0 create mode 100644 usr/share/man/cat3/setttyent.0 create mode 100644 usr/share/man/cat3/setusershell.0 create mode 100644 usr/share/man/cat3/setvbuf.0 create mode 100644 usr/share/man/cat3/sigaddset.0 create mode 100644 usr/share/man/cat3/sigdelset.0 create mode 100644 usr/share/man/cat3/sigemptyset.0 create mode 100644 usr/share/man/cat3/sigfillset.0 create mode 100644 usr/share/man/cat3/siginterrupt.0 create mode 100644 usr/share/man/cat3/sigismember.0 create mode 100644 usr/share/man/cat3/siglongjmp.0 create mode 100644 usr/share/man/cat3/signal.0 create mode 100644 usr/share/man/cat3/sigsetjmp.0 create mode 100644 usr/share/man/cat3/sigsetops.0 create mode 100644 usr/share/man/cat3/sleep.0 create mode 100644 usr/share/man/cat3/snprintf.0 create mode 100644 usr/share/man/cat3/sprintf.0 create mode 100644 usr/share/man/cat3/srand.0 create mode 100644 usr/share/man/cat3/srandom.0 create mode 100644 usr/share/man/cat3/sscanf.0 create mode 100644 usr/share/man/cat3/stdio.0 create mode 100644 usr/share/man/cat3/strcasecmp.0 create mode 100644 usr/share/man/cat3/strcat.0 create mode 100644 usr/share/man/cat3/strchr.0 create mode 100644 usr/share/man/cat3/strcmp.0 create mode 100644 usr/share/man/cat3/strcoll.0 create mode 100644 usr/share/man/cat3/strcpy.0 create mode 100644 usr/share/man/cat3/strcspn.0 create mode 100644 usr/share/man/cat3/strdup.0 create mode 100644 usr/share/man/cat3/strerror.0 create mode 100644 usr/share/man/cat3/strftime.0 create mode 100644 usr/share/man/cat3/string.0 create mode 100644 usr/share/man/cat3/strlen.0 create mode 100644 usr/share/man/cat3/strmode.0 create mode 100644 usr/share/man/cat3/strncasecmp.0 create mode 100644 usr/share/man/cat3/strncat.0 create mode 100644 usr/share/man/cat3/strncmp.0 create mode 100644 usr/share/man/cat3/strncpy.0 create mode 100644 usr/share/man/cat3/strpbrk.0 create mode 100644 usr/share/man/cat3/strrchr.0 create mode 100644 usr/share/man/cat3/strsep.0 create mode 100644 usr/share/man/cat3/strspn.0 create mode 100644 usr/share/man/cat3/strstr.0 create mode 100644 usr/share/man/cat3/strtod.0 create mode 100644 usr/share/man/cat3/strtok.0 create mode 100644 usr/share/man/cat3/strtol.0 create mode 100644 usr/share/man/cat3/strtoq.0 create mode 100644 usr/share/man/cat3/strtoul.0 create mode 100644 usr/share/man/cat3/strtouq.0 create mode 100644 usr/share/man/cat3/strxfrm.0 create mode 100644 usr/share/man/cat3/swab.0 create mode 100644 usr/share/man/cat3/sys_siglist.0 create mode 100644 usr/share/man/cat3/sysconf.0 create mode 100644 usr/share/man/cat3/sysctl.0 create mode 100644 usr/share/man/cat3/syslog.0 create mode 100644 usr/share/man/cat3/system.0 create mode 100644 usr/share/man/cat3/tcdrain.0 create mode 100644 usr/share/man/cat3/tcflow.0 create mode 100644 usr/share/man/cat3/tcflush.0 create mode 100644 usr/share/man/cat3/tcgetattr.0 create mode 100644 usr/share/man/cat3/tcgetpgrp.0 create mode 100644 usr/share/man/cat3/tcsendbreak.0 create mode 100644 usr/share/man/cat3/tcsetattr.0 create mode 100644 usr/share/man/cat3/tcsetpgrp.0 create mode 100644 usr/share/man/cat3/telldir.0 create mode 100644 usr/share/man/cat3/tempnam.0 create mode 100644 usr/share/man/cat3/time.0 create mode 100644 usr/share/man/cat3/times.0 create mode 100644 usr/share/man/cat3/timezone.0 create mode 100644 usr/share/man/cat3/tmpfile.0 create mode 100644 usr/share/man/cat3/tmpnam.0 create mode 100644 usr/share/man/cat3/toascii.0 create mode 100644 usr/share/man/cat3/tolower.0 create mode 100644 usr/share/man/cat3/toupper.0 create mode 100644 usr/share/man/cat3/ttyname.0 create mode 100644 usr/share/man/cat3/ttyslot.0 create mode 100644 usr/share/man/cat3/tzset.0 create mode 100644 usr/share/man/cat3/tzsetwall.0 create mode 100644 usr/share/man/cat3/ualarm.0 create mode 100644 usr/share/man/cat3/ungetc.0 create mode 100644 usr/share/man/cat3/unsetenv.0 create mode 100644 usr/share/man/cat3/unvis.0 create mode 100644 usr/share/man/cat3/user_from_uid.0 create mode 100644 usr/share/man/cat3/usleep.0 create mode 100644 usr/share/man/cat3/utime.0 create mode 100644 usr/share/man/cat3/valloc.0 create mode 100644 usr/share/man/cat3/verr.0 create mode 100644 usr/share/man/cat3/verrx.0 create mode 100644 usr/share/man/cat3/vfprintf.0 create mode 100644 usr/share/man/cat3/vfscanf.0 create mode 100644 usr/share/man/cat3/vis.0 create mode 100644 usr/share/man/cat3/vprintf.0 create mode 100644 usr/share/man/cat3/vscanf.0 create mode 100644 usr/share/man/cat3/vsnprintf.0 create mode 100644 usr/share/man/cat3/vsprintf.0 create mode 100644 usr/share/man/cat3/vsscanf.0 create mode 100644 usr/share/man/cat3/vsyslog.0 create mode 100644 usr/share/man/cat3/vwarn.0 create mode 100644 usr/share/man/cat3/vwarnx.0 create mode 100644 usr/share/man/cat3/warn.0 create mode 100644 usr/share/man/cat3/warnx.0 create mode 100644 usr/share/man/cat3/zopen.0 create mode 100644 usr/share/man/cat4/euc.0 create mode 100644 usr/share/man/cat4/utf2.0 create mode 100644 usr/share/man/cat7/re_format.0 create mode 100644 usr/src/Domestic/man/crypt.0.3 diff --git a/usr/share/man/cat2/__syscall.0 b/usr/share/man/cat2/__syscall.0 new file mode 100644 index 0000000000..86df1c0e55 --- /dev/null +++ b/usr/share/man/cat2/__syscall.0 @@ -0,0 +1,37 @@ +SYSCALL(2) BSD Programmer's Manual SYSCALL(2) + +NNAAMMEE + ssyyssccaallll, ____ssyyssccaallll - indirect system call + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssyyssccaallll(_i_n_t _n_u_m_b_e_r, _._._.); + + _i_n_t + ____ssyyssccaallll(_q_u_a_d___t _n_u_m_b_e_r, _._._.); + +DDEESSCCRRIIPPTTIIOONN + SSyyssccaallll() performs the system call whose assembly language interface has + the specified _n_u_m_b_e_r with the specified arguments. Symbolic constants + for system calls can be found in the header file <_s_y_s_/_s_y_s_c_a_l_l_._h>. The + ____ssyyssccaallll form should be used when one or more of the parameters is a + 64-bit argument to ensure that argument alignment is correct. This sys- + tem call is useful for testing new system calls that do not have entries + in the C library. + +RREETTUURRNN VVAALLUUEESS + The return values are defined by the system call being invoked. In gen- + eral, a 0 return value indicates success. A -1 return value indicates an + error, and an error code is stored in _e_r_r_n_o. + +BBUUGGSS + There is no way to simulate system calls that have multiple return values + such as pipe(2). + +HHIISSTTOORRYY + The ssyyssccaallll function call appeared in 4.0BSD. + +4th Berkeley Distribution June 16, 1993 1 diff --git a/usr/share/man/cat2/_exit.0 b/usr/share/man/cat2/_exit.0 new file mode 100644 index 0000000000..07705f88f4 --- /dev/null +++ b/usr/share/man/cat2/_exit.0 @@ -0,0 +1,52 @@ +EXIT(2) BSD Programmer's Manual EXIT(2) + +NNAAMMEE + __eexxiitt - terminate the calling process + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + __eexxiitt(_i_n_t _s_t_a_t_u_s); + +DDEESSCCRRIIPPTTIIOONN + The __eexxiitt() function terminates a process with the following conse- + quences: + + ++oo All of the descriptors open in the calling process are closed. This + may entail delays, for example, waiting for output to drain; a pro- + cess in this state may not be killed, as it is already dying. + + ++oo If the parent process of the calling process has an outstanding wait + call or catches the SIGCHLD signal, it is notified of the calling + process's termination and the _s_t_a_t_u_s is set as defined by wait(2). + + ++oo The parent process-ID of all of the calling process's existing child + processes are set to 1; the initialization process (see the DEFINI- + TIONS section of intro(2)) inherits each of these processes. + + ++oo If the termination of the process causes any process group to become + orphaned (usually because the parents of all members of the group + have now exited; see ``orphaned process group'' in intro(2)), and if + any member of the orphaned group is stopped, the SIGHUP signal and + the SIGCONT signal are sent to all members of the newly-orphaned pro- + cess group. + + ++oo If the process is a controlling process (see intro(2)), the SIGHUP + signal is sent to the foreground process group of the controlling + terminal, and all current access to the controlling terminal is re- + voked. + + Most C programs call the library routine exit(3), which flushes buffers, + closes streams, unlinks temporary files, etc., before calling __eexxiitt(). + +RREETTUURRNN VVAALLUUEE + __eexxiitt() can never return. + +SSEEEE AALLSSOO + fork(2), sigvec(2), wait(2), exit(3) + +SSTTAANNDDAARRDDSS + The __eexxiitt function is defined by IEEE Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/accept.0 b/usr/share/man/cat2/accept.0 new file mode 100644 index 0000000000..23c7b06ba1 --- /dev/null +++ b/usr/share/man/cat2/accept.0 @@ -0,0 +1,79 @@ +ACCEPT(2) BSD Programmer's Manual ACCEPT(2) + +NNAAMMEE + aacccceepptt - accept a connection on a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + aacccceepptt(_i_n_t _s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_a_d_d_r, _i_n_t _*_a_d_d_r_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The argument _s is a socket that has been created with socket(2), bound + to an address with bind(2), and is listening for connections after a + listen(2). The aacccceepptt() argument extracts the first connection request + on the queue of pending connections, creates a new socket with the same + properties of _s and allocates a new file descriptor for the socket. If + no pending connections are present on the queue, and the socket is not + marked as non-blocking, aacccceepptt() blocks the caller until a connection is + present. If the socket is marked non-blocking and no pending connections + are present on the queue, aacccceepptt() returns an error as described below. + The accepted socket may not be used to accept more connections. The + original socket _s remains open. + + The argument _a_d_d_r is a result parameter that is filled in with the ad- + dress of the connecting entity, as known to the communications layer. + The exact format of the _a_d_d_r parameter is determined by the domain in + which the communication is occurring. The _a_d_d_r_l_e_n is a value-result pa- + rameter; it should initially contain the amount of space pointed to by + _a_d_d_r; on return it will contain the actual length (in bytes) of the ad- + dress returned. This call is used with connection-based socket types, + currently with SOCK_STREAM. + + It is possible to select(2) a socket for the purposes of doing an + aacccceepptt() by selecting it for read. + + For certain protocols which require an explicit confirmation, such as ISO + or DATAKIT, aacccceepptt() can be thought of as merely dequeueing the next con- + nection request and not implying confirmation. Confirmation can be im- + plied by a normal read or write on the new file desciptor, and rejection + can be implied by closing the new socket. + + One can obtain user connection request data without confirming the con- + nection by issuing a recvmsg(2) call with an _m_s_g___i_o_v_l_e_n of 0 and a non- + zero _m_s_g___c_o_n_t_r_o_l_l_e_n, or by issuing a getsockopt(2) request. Similarly, + one can provide user connection rejection information by issuing a + sendmsg(2) call with providing only the control information, or by call- + ing setsockopt(2). + +RREETTUURRNN VVAALLUUEESS + The call returns -1 on error. If it succeeds, it returns a non-negative + integer that is a descriptor for the accepted socket. + +EERRRROORRSS + The aacccceepptt() will fail if: + + [EBADF] The descriptor is invalid. + + [ENOTSOCK] The descriptor references a file, not a socket. + + [EOPNOTSUPP] + The referenced socket is not of type SOCK_STREAM. + + [EFAULT] The _a_d_d_r parameter is not in a writable part of the user ad- + + dress space. + + [EWOULDBLOCK] + The socket is marked non-blocking and no connections are + present to be accepted. + +SSEEEE AALLSSOO + bind(2), connect(2), listen(2), select(2), socket(2) + +HHIISSTTOORRYY + The aacccceepptt function appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/access.0 b/usr/share/man/cat2/access.0 new file mode 100644 index 0000000000..f70b554232 --- /dev/null +++ b/usr/share/man/cat2/access.0 @@ -0,0 +1,82 @@ +ACCESS(2) BSD Programmer's Manual ACCESS(2) + +NNAAMMEE + aacccceessss - check access permissions of a file or pathname + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aacccceessss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + The aacccceessss() function checks the accessibility of the file named by _p_a_t_h + for the access permissions indicated by _m_o_d_e. The value of _m_o_d_e is the + bitwise inclusive OR of the access permissions to be checked (R_OK for + read permission, W_OK for write permission and X_OK for execute/search + permission) or the existence test, F_OK. All components of the pathname + _p_a_t_h are checked for access permissions (including F_OK). + + The real user ID is used in place of the effective user ID and the real + group access list (including the real group ID) are used in place of the + effective ID for verifying permission. + + Even if a process has appropriate privileges and indicates success for + X_OK, the file may not actually have execute permission bits set. Like- + wise for R_OK and W_OK. + +RREETTUURRNN VVAALLUUEESS + If _p_a_t_h cannot be found or if any of the desired access modes would not + be granted, then a -1 value is returned; otherwise a 0 value is returned. + +EERRRROORRSS + Access to the file is denied if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EROFS] Write access is requested for a file on a read-only file + system. + + [ETXTBSY] Write access is requested for a pure procedure (shared + text) file presently being executed. + + [EACCES] Permission bits of the file mode do not permit the request- + ed access, or search permission is denied on a component of + the path prefix. The owner of a file has permission + checked with respect to the ``owner'' read, write, and exe- + cute mode bits, members of the file's group other than the + owner have permission checked with respect to the ``group'' + mode bits, and all others have permissions checked with re- + + spect to the ``other'' mode bits. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chmod(2), stat(2) + +SSTTAANNDDAARRDDSS + AAcccceessss() conforms to IEEE Std 1003.1-1988 (``POSIX''). + +CCAAVVEEAATT + AAcccceessss() is a potential security hole and should never be used. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/acct.0 b/usr/share/man/cat2/acct.0 new file mode 100644 index 0000000000..114a133d72 --- /dev/null +++ b/usr/share/man/cat2/acct.0 @@ -0,0 +1,70 @@ +ACCT(2) BSD Programmer's Manual ACCT(2) + +NNAAMMEE + aacccctt - enable or disable process accounting + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aacccctt(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + +DDEESSCCRRIIPPTTIIOONN + The aacccctt() call enables or disables the collection of system accounting + records. If the argument _f_i_l_e is a nil pointer, accounting is disabled. + If _f_i_l_e is an _e_x_i_s_t_i_n_g pathname (null-terminated), record collection is + enabled and for every process initiated which terminates under normal + conditions an accounting record is appended to _f_i_l_e. Abnormal conditions + of termination are reboots or other fatal system problems. Records for + processes which never terminate can not be produced by aacccctt(). + + For more information on the record structure used by aacccctt(), see + _/_u_s_r_/_i_n_c_l_u_d_e_/_s_y_s_/_a_c_c_t_._h and acct(5). + + This call is permitted only to the super-user. + +NNOOTTEESS + Accounting is automatically disabled when the file system the accounting + file resides on runs out of space; it is enabled when space once again + becomes available. + +RREETTUURRNN VVAALLUUEESS + On error -1 is returned. The file must exist and the call may be exer- + cised only by the super-user. + +EERRRROORRSS + AAcccctt() will fail if one of the following is true: + + [EPERM] The caller is not the super-user. + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix, or the path name is not a regular file. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _F_i_l_e points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + acct(5), sa(8) + +HHIISSTTOORRYY + An aacccctt function call appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/adjtime.0 b/usr/share/man/cat2/adjtime.0 new file mode 100644 index 0000000000..fe9d47e556 --- /dev/null +++ b/usr/share/man/cat2/adjtime.0 @@ -0,0 +1,55 @@ +ADJTIME(2) BSD Programmer's Manual ADJTIME(2) + +NNAAMMEE + aaddjjttiimmee - correct the time to allow synchronization of the system clock + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aaddjjttiimmee(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_d_e_l_t_a, _s_t_r_u_c_t _t_i_m_e_v_a_l _*_o_l_d_d_e_l_t_a); + +DDEESSCCRRIIPPTTIIOONN + AAddjjttiimmee() makes small adjustments to the system time, as returned by + gettimeofday(2), advancing or retarding it by the time specified by the + timeval _d_e_l_t_a. If _d_e_l_t_a is negative, the clock is slowed down by incre- + menting it more slowly than normal until the correction is complete. If + _d_e_l_t_a is positive, a larger increment than normal is used. The skew used + to perform the correction is generally a fraction of one percent. Thus, + the time is always a monotonically increasing function. A time correc- + tion from an earlier call to aaddjjttiimmee() may not be finished when aaddjjttiimmee() + is called again. If _o_l_d_d_e_l_t_a is non-nil, the structure pointed to will + contain, upon return, the number of microseconds still to be corrected + from the earlier call. + + This call may be used by time servers that synchronize the clocks of com- + puters in a local area network. Such time servers would slow down the + clocks of some machines and speed up the clocks of others to bring them + to the average network time. + + The call aaddjjttiimmee() is restricted to the super-user. + +RREETTUURRNN VVAALLUUEESS + A return value of 0 indicates that the call succeeded. A return value of + -1 indicates that an error occurred, and in this case an error code is + stored in the global variable _e_r_r_n_o. + +EERRRROORRSS + AAddjjttiimmee() will fail if: + + [EFAULT] An argument points outside the process's allocated address + space. + + [EPERM] The process's effective user ID is not that of the super- + user. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), timed(8), timedc(8), + + R. Gusella, and S. Zatti, _T_S_P_: _T_h_e _T_i_m_e _S_y_n_c_h_r_o_n_i_z_a_t_i_o_n _P_r_o_t_o_c_o_l _f_o_r _U_N_I_X + _4_._3_B_S_D. + +HHIISSTTOORRYY + The aaddjjttiimmee function call appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/bind.0 b/usr/share/man/cat2/bind.0 new file mode 100644 index 0000000000..c4a85f3d82 --- /dev/null +++ b/usr/share/man/cat2/bind.0 @@ -0,0 +1,82 @@ +BIND(2) BSD Programmer's Manual BIND(2) + +NNAAMMEE + bbiinndd - bind a name to a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + bbiinndd(_i_n_t _s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + BBiinndd() assigns a name to an unnamed socket. When a socket is created + with socket(2) it exists in a name space (address family) but has no name + assigned. BBiinndd() requests that _n_a_m_e be assigned to the socket. + +NNOOTTEESS + Binding a name in the UNIX domain creates a socket in the file system + that must be deleted by the caller when it is no longer needed (using + unlink(2)). + + The rules used in name binding vary between communication domains. Con- + sult the manual entries in section 4 for detailed information. + +RREETTUURRNN VVAALLUUEESS + If the bind is successful, a 0 value is returned. A return value of -1 + indicates an error, which is further specified in the global _e_r_r_n_o. + +EERRRROORRSS + The bbiinndd() call will fail if: + + [EBADF] _S is not a valid descriptor. + + [ENOTSOCK] _S is not a socket. + + [EADDRNOTAVAIL] + The specified address is not available from the local ma- + chine. + + [EADDRINUSE] + The specified address is already in use. + + [EINVAL] The socket is already bound to an address. + + [EACCES] The requested address is protected, and the current user has + inadequate permission to access it. + + [EFAULT] The _n_a_m_e parameter is not in a valid part of the user ad- + dress space. + + The following errors are specific to binding names in the UNIX domain. + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] A prefix component of the path name does not exist. + + [ELOOP] Too many symbolic links were encountered in translating the + + pathname. + + [EIO] An I/O error occurred while making the directory entry or + allocating the inode. + + [EROFS] The name would reside on a read-only file system. + + [EISDIR] An empty pathname was specified. + +SSEEEE AALLSSOO + connect(2), listen(2), socket(2), getsockname(2) + +HHIISSTTOORRYY + The bbiinndd function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/brk.0 b/usr/share/man/cat2/brk.0 new file mode 100644 index 0000000000..2c100de3ac --- /dev/null +++ b/usr/share/man/cat2/brk.0 @@ -0,0 +1,61 @@ +BRK(2) BSD Programmer's Manual BRK(2) + +NNAAMMEE + bbrrkk, ssbbrrkk - change data segment size + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r + **bbrrkk(_c_o_n_s_t _c_h_a_r _*_a_d_d_r); + + _c_h_a_r _* + **ssbbrrkk(_i_n_t _i_n_c_r); + +DDEESSCCRRIIPPTTIIOONN + TThhee bbrrkk aanndd ssbbrrkk ffuunnccttiioonnss aarree hhiissttoorriiccaall ccuurriioossiittiieess lleefftt oovveerr ffrroomm eeaarr-- + lliieerr ddaayyss bbeeffoorree tthhee aaddvveenntt ooff vviirrttuuaall mmeemmoorryy mmaannaaggeemmeenntt.. The bbrrkk() + function sets the break or lowest address of a process's data segment + (unilitialized data) to _a_d_d_r (immediately above bss). Data addressing is + restricted between _a_d_d_r and the lowest stack pointer to the stack seg- + ment. Memory is allocated by _b_r_k in page size pieces; if _a_d_d_r is not + evenly divisible by the system page size, it is increased to the next + page boundary. + + The current value of the program break is reliably returned by + ``sbrk(0)'' (see also end(3)). The getrlimit(2) system call may be used + to determine the maximum permissible size of the _d_a_t_a segment; it will + not be possible to set the break beyond the _r_l_i_m___m_a_x value returned from + a call to getrlimit, e.g. ``qetext + rlp->rlim_max.'' (see end(3) for + the definition of _e_t_e_x_t). + +RREETTUURRNN VVAALLUUEESS + BBrrkk returns a pointer to the new end of memory if successful; otherwise + -1 with _e_r_r_n_o set to indicate why the allocation failed. The ssbbrrkk re- + turns a pointer to the base of the new storage if successful; otherwise + -1 with _e_r_r_n_o set to indicate why the allocation failed. + +EERRRROORRSS + Sbrk will fail and no additional memory will be allocated if one of the + following are true: + + [ENOMEM] The limit, as set by setrlimit(2), was exceeded. + + [ENOMEM] The maximum possible size of a data segment (compiled into the + system) was exceeded. + + [ENOMEM] Insufficient space existed in the swap area to support the ex- + pansion. + +SSEEEE AALLSSOO + execve(2), getrlimit(2), malloc(3), end(3) + +BBUUGGSS + Setting the break may fail due to a temporary lack of swap space. It is + not possible to distinguish this from a failure caused by exceeding the + maximum size of the data segment without consulting getrlimit. + +HHIISSTTOORRYY + A bbrrkk function call appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/chdir.0 b/usr/share/man/cat2/chdir.0 new file mode 100644 index 0000000000..b742384588 --- /dev/null +++ b/usr/share/man/cat2/chdir.0 @@ -0,0 +1,79 @@ +CHDIR(2) BSD Programmer's Manual CHDIR(2) + +NNAAMMEE + cchhddiirr, ffcchhddiirr - change current working directory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhddiirr(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); + + _i_n_t + ffcchhddiirr(_i_n_t _f_d); + +DDEESSCCRRIIPPTTIIOONN + The _p_a_t_h arument points to the pathname of a directory. The cchhddiirr() + function causes the named directory to become the current working direc- + tory, that is, the starting point for path searches of pathnames not be- + ginning with a slash, `/'. + + The ffcchhddiirr() function causes the directory referenced by _f_d to become the + current working directory, the starting point for path searches of path- + names not beginning with a slash, `/'. + + In order for a directory to become the current directory, a process must + have execute (search) access to the directory. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhddiirr() will fail and the current working directory will be unchanged if + one or more of the following are true: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named directory does not exist. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EACCES] Search permission is denied for any component of the path + name. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhddiirr() will fail and the current working directory will be unchanged if + one or more of the following are true: + + [EACCES] Search permission is denied for the directory referenced by + the file descriptor. + + + + [ENOTDIR] The file descriptor does not reference a directory. + + [EBADF] The argument _f_d is not a valid file descriptor. + +SSEEEE AALLSSOO + chroot(2) + +SSTTAANNDDAARRDDSS + CChhddiirr() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhddiirr() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/chflags.0 b/usr/share/man/cat2/chflags.0 new file mode 100644 index 0000000000..46217eadaf --- /dev/null +++ b/usr/share/man/cat2/chflags.0 @@ -0,0 +1,90 @@ +CHFLAGS(2) BSD Programmer's Manual CHFLAGS(2) + +NNAAMMEE + cchhffllaaggss, ffcchhffllaaggss - set file flags + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + cchhffllaaggss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _u___l_o_n_g _f_l_a_g_s); + + _i_n_t + ffcchhffllaaggss(_i_n_t _f_d, _u___l_o_n_g _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The file whose name is given by _p_a_t_h or referenced by the descriptor _f_d + has its flags changed to _f_l_a_g_s. + + The flags specified are formed by _o_r'ing the following values + + UF_NODUMP Do not dump the file. + UF_IMMUTABLE The file may not be changed. + UF_APPEND The file may only be appended to. + SF_IMMUTABLE The file may not be changed. + SF_APPEND The file may only be appended to. + + The ``UF_IMMUTABLE'' and ``UF_APPEND'' flags may be set or unset by ei- + ther the owner of a file or the super-user. + + The ``SF_IMMUTABLE'' and ``SF_APPEND'' flags may only be set or unset by + the super-user. They may be set at any time, but normally may only be + unset when the system is in single-user mode. (See init(8) for details.) + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhffllaaggss() will fail it: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhffllaaggss() will fail if: + + [EBADF] The descriptor is not valid. + + [EINVAL] _F_d refers to a socket, not to a file. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chflags(1,) init(8) + +HHIISSTTOORRYY + The cchhffllaaggss and ffcchhffllaaggss functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/chmod.0 b/usr/share/man/cat2/chmod.0 new file mode 100644 index 0000000000..997765e9f8 --- /dev/null +++ b/usr/share/man/cat2/chmod.0 @@ -0,0 +1,113 @@ +CHMOD(2) BSD Programmer's Manual CHMOD(2) + +NNAAMMEE + cchhmmoodd, ffcchhmmoodd - change mode of file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhmmoodd(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e); + + _i_n_t + ffcchhmmoodd(_i_n_t _f_d, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + The function cchhmmoodd() sets the file permission bits of the file specified + by the pathname _p_a_t_h to _m_o_d_e. FFcchhmmoodd() sets the permission bits of the + specified file descriptor _f_d. CChhmmoodd() verifies that the process owner + (user) either owns the file specified by _p_a_t_h (or _f_d), or is the super- + user. A mode is created from _o_r _A_p _d permission bit masks defined in + <_s_y_s_/_s_t_a_t_._h>: + #define S_IRWXU 0000700 /* RWX mask for owner */ + #define S_IRUSR 0000400 /* R for owner */ + #define S_IWUSR 0000200 /* W for owner */ + #define S_IXUSR 0000100 /* X for owner */ + + #define S_IRWXG 0000070 /* RWX mask for group */ + #define S_IRGRP 0000040 /* R for group */ + #define S_IWGRP 0000020 /* W for group */ + #define S_IXGRP 0000010 /* X for group */ + + #define S_IRWXO 0000007 /* RWX mask for other */ + #define S_IROTH 0000004 /* R for other */ + #define S_IWOTH 0000002 /* W for other */ + #define S_IXOTH 0000001 /* X for other */ + + #define S_ISUID 0004000 /* set user id on execution */ + #define S_ISGID 0002000 /* set group id on execution */ + #define S_ISVTX 0001000 /* save swapped text even after use */ + + The ISVTX (the _s_t_i_c_k_y _b_i_t) indicates to the system which executable files + are shareable (the default) and the system maintains the program text of + the files in the swap area. The sticky bit may only be set by the super + user on shareable executable files. + + If mode ISVTX (the `sticky bit') is set on a directory, an unprivileged + user may not delete or rename files of other users in that directory. The + sticky bit may be set by any user on a directory which the user owns or + has appropriate permissions. For more details of the properties of the + sticky bit, see sticky(8). + + Writing or changing the owner of a file turns off the set-user-id and + set-group-id bits unless the user is the super-user. This makes the sys- + tem somewhat more secure by protecting set-user-id (set-group-id) files + from remaining set-user-id (set-group-id) if they are modified, at the + expense of a degree of compatibility. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhmmoodd() will fail and the file mode will be unchanged if: + + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhmmoodd() will fail if: + + [EBADF] The descriptor is not valid. + + [EINVAL] _F_d refers to a socket, not to a file. + + [EROFS] The file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chmod(1), open(2), chown(2), stat(2), sticky(8) + +SSTTAANNDDAARRDDSS + CChhmmoodd() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhmmoodd() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/chown.0 b/usr/share/man/cat2/chown.0 new file mode 100644 index 0000000000..907ce09f4f --- /dev/null +++ b/usr/share/man/cat2/chown.0 @@ -0,0 +1,92 @@ +CHOWN(2) BSD Programmer's Manual CHOWN(2) + +NNAAMMEE + cchhoowwnn, ffcchhoowwnn - change owner and group of a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhoowwnn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _u_i_d___t _o_w_n_e_r, _g_i_d___t _g_r_o_u_p); + + _i_n_t + ffcchhoowwnn(_i_n_t _f_d, _u_i_d___t _o_w_n_e_r, _u_i_d___t _g_r_o_u_p); + +DDEESSCCRRIIPPTTIIOONN + The owner ID and group ID of the file named by _p_a_t_h or referenced by _f_d + is changed as specified by the arguments _o_w_n_e_r and _g_r_o_u_p. The owner of a + file may change the _g_r_o_u_p to a group of which he or she is a member, but + the change _o_w_n_e_r capability is restricted to the super-user. + + CChhoowwnn() clears the set-user-id and set-group-id bits on the file to pre- + vent accidental or mischievious creation of set-user-id and set-group-id + programs. + + FFcchhoowwnn() is particularly useful when used in conjunction with the file + locking primitives (see flock(2)). + + One of the owner or group id's may be left unchanged by specifying it as + -1. + + If the final component of _p_a_t_h is a symbolic link, the ownership and + group of the symbolic link is changed, not the ownership and group of the + file or directory to which it points. + +RREETTUURRNN VVAALLUUEESS + Zero is returned if the operation was successful; -1 is returned if an + error occurs, with a more specific error code being placed in the global + variable _e_r_r_n_o. + +EERRRROORRSS + CChhoowwnn() will fail and the file will be unchanged if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhoowwnn() will fail if: + + [EBADF] _F_d does not refer to a valid descriptor. + + [EINVAL] _F_d refers to a socket, not a file. + + [EPERM] The effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chown(8), chgrp(1), chmod(2), flock(2) + +SSTTAANNDDAARRDDSS + CChhoowwnn() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhoowwnn() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/chroot.0 b/usr/share/man/cat2/chroot.0 new file mode 100644 index 0000000000..3893076f2b --- /dev/null +++ b/usr/share/man/cat2/chroot.0 @@ -0,0 +1,59 @@ +CHROOT(2) BSD Programmer's Manual CHROOT(2) + +NNAAMMEE + cchhrroooott - change root directory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhrroooott(_c_o_n_s_t _c_h_a_r _*_d_i_r_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + _D_i_r_n_a_m_e is the address of the pathname of a directory, terminated by an + ASCII NUL. CChhrroooott() causes _d_i_r_n_a_m_e to become the root directory, that + is, the starting point for path searches of pathnames beginning with `/'. + + In order for a directory to become the root directory a process must have + execute (search) access for that directory. + + It should be noted that cchhrroooott() has no effect on the process's current + directory. + + This call is restricted to the super-user. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate an error. + +EERRRROORRSS + CChhrroooott() will fail and the root directory will be unchanged if: + + [ENOTDIR] A component of the path name is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] The named directory does not exist. + + [EACCES] Search permission is denied for any component of the path + name. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chdir(2) + +HHIISSTTOORRYY + The cchhrroooott function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/close.0 b/usr/share/man/cat2/close.0 new file mode 100644 index 0000000000..2953a3bdfd --- /dev/null +++ b/usr/share/man/cat2/close.0 @@ -0,0 +1,57 @@ +CLOSE(2) BSD Programmer's Manual CLOSE(2) + +NNAAMMEE + cclloossee - delete a descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cclloossee(_i_n_t _d); + +DDEESSCCRRIIPPTTIIOONN + The cclloossee() call deletes a descriptor from the per-process object refer- + ence table. If this is the last reference to the underlying object, the + object will be deactivated. For example, on the last close of a file the + current _s_e_e_k pointer associated with the file is lost; on the last close + of a socket(2) associated naming information and queued data are discard- + ed; on the last close of a file holding an advisory lock the lock is re- + leased (see further flock(2)). + + When a process exits, all associated file descriptors are freed, but + since there is a limit on active descriptors per processes, the cclloossee() + function call is useful when a large quanitity of file descriptors are + being handled. + + When a process forks (see fork(2)), all descriptors for the new child + process reference the same objects as they did in the parent before the + fork. If a new process is then to be run using execve(2), the process + would normally inherit these descriptors. Most of the descriptors can be + rearranged with dup2(2) or deleted with cclloossee() before the execve is at- + tempted, but if some of these descriptors will still be needed if the ex- + ecve fails, it is necessary to arrange for them to be closed if the ex- + ecve succeeds. For this reason, the call ``fcntl(d, F_SETFD, 1)'' is + provided, which arranges that a descriptor will be closed after a suc- + cessful execve; the call ``fcntl(d, F_SETFD, 0)'' restores the default, + which is to not close the descriptor. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and the global integer variable _e_r_r_n_o is set to indi- + cate the error. + +EERRRROORRSS + CClloossee() will fail if: + + [EBADF] _D is not an active descriptor. + + [EINTR] An interupt was received. + +SSEEEE AALLSSOO + accept(2), flock(2), open(2), pipe(2), socket(2), socketpair(2), + execve(2), fcntl(2) + +SSTTAANNDDAARRDDSS + CClloossee() conforms to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/connect.0 b/usr/share/man/cat2/connect.0 new file mode 100644 index 0000000000..e9f195dfb4 --- /dev/null +++ b/usr/share/man/cat2/connect.0 @@ -0,0 +1,92 @@ +CONNECT(2) BSD Programmer's Manual CONNECT(2) + +NNAAMMEE + ccoonnnneecctt - initiate a connection on a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ccoonnnneecctt(_i_n_t _s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The parameter _s is a socket. If it is of type SOCK_DGRAM, this call + specifies the peer with which the socket is to be associated; this ad- + dress is that to which datagrams are to be sent, and the only address + from which datagrams are to be received. If the socket is of type + SOCK_STREAM, this call attempts to make a connection to another socket. + The other socket is specified by _n_a_m_e, which is an address in the commu- + nications space of the socket. Each communications space interprets the + _n_a_m_e parameter in its own way. Generally, stream sockets may successful- + ly ccoonnnneecctt() only once; datagram sockets may use ccoonnnneecctt() multiple times + to change their association. Datagram sockets may dissolve the associa- + tion by connecting to an invalid address, such as a null address. + +RREETTUURRNN VVAALLUUEESS + If the connection or binding succeeds, 0 is returned. Otherwise a -1 is + returned, and a more specific error code is stored in _e_r_r_n_o. + +EERRRROORRSS + The ccoonnnneecctt() call fails if: + + [EBADF] _S is not a valid descriptor. + + [ENOTSOCK] _S is a descriptor for a file, not a socket. + + [EADDRNOTAVAIL] The specified address is not available on this machine. + + [EAFNOSUPPORT] Addresses in the specified address family cannot be + used with this socket. + + [EISCONN] The socket is already connected. + + [ETIMEDOUT] Connection establishment timed out without establishing + a connection. + + [ECONNREFUSED] The attempt to connect was forcefully rejected. + + [ENETUNREACH] The network isn't reachable from this host. + + [EADDRINUSE] The address is already in use. + + [EFAULT] The _n_a_m_e parameter specifies an area outside the pro- + cess address space. + + [EINPROGRESS] The socket is non-blocking and the connection cannot be + completed immediately. It is possible to select(2) for + completion by selecting the socket for writing. + + [EALREADY] The socket is non-blocking and a previous connection + attempt has not yet been completed. + + The following errors are specific to connecting names in the UNIX domain. + + + These errors may not apply in future versions of the UNIX IPC domain. + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order + bit set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or + an entire path name exceeded 1023 characters. + + [ENOENT] The named socket does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [EACCES] Write access to the named socket is denied. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + +SSEEEE AALLSSOO + accept(2), select(2), socket(2), getsockname(2) + +HHIISSTTOORRYY + The ccoonnnneecctt function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/creat.0 b/usr/share/man/cat2/creat.0 new file mode 100644 index 0000000000..e2524ea9f0 --- /dev/null +++ b/usr/share/man/cat2/creat.0 @@ -0,0 +1,25 @@ +CREAT(2) BSD Programmer's Manual CREAT(2) + +NNAAMMEE + ccrreeaatt - create a new file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccrreeaatt(_c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy:: open(2). + + CCrreeaatt() is the same as: + + open(path, O_CREAT | O_TRUNC | O_WRONLY, mode); + +SSEEEE AALLSSOO + open(2) + +HHIISSTTOORRYY + The ccrreeaatt function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/dup.0 b/usr/share/man/cat2/dup.0 new file mode 100644 index 0000000000..c1360d16cf --- /dev/null +++ b/usr/share/man/cat2/dup.0 @@ -0,0 +1,55 @@ +DUP(2) BSD Programmer's Manual DUP(2) + +NNAAMMEE + dduupp, dduupp22 - duplicate an existing file descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + dduupp(_i_n_t _o_l_d_d); + + _i_n_t + dduupp22(_i_n_t _o_l_d_d, _i_n_t _n_e_w_d); + +DDEESSCCRRIIPPTTIIOONN + DDuupp() duplicates an existing object descriptor and returns its value to + the calling process (_n_e_w_d = dduupp(_o_l_d_d)). The argument _o_l_d_d is a small non- + negative integer index in the per-process descriptor table. The value + must be less than the size of the table, which is returned by + getdtablesize(2). The new descriptor returned by the call is the lowest + numbered descriptor currently not in use by the process. + + The object referenced by the descriptor does not distinguish between _o_l_d_d + and _n_e_w_d in any way. Thus if _n_e_w_d and _o_l_d_d are duplicate references to + an open file, read(2), write(2) and lseek(2) calls all move a single + pointer into the file, and append mode, non-blocking I/O and asynchronous + I/O options are shared between the references. If a separate pointer in- + to the file is desired, a different object reference to the file must be + obtained by issuing an additional open(2) call. The close-on-exec flag + on the new file descriptor is unset. + + In dduupp22(), the value of the new descriptor _n_e_w_d is specified. If this + descriptor is already in use, the descriptor is first deallocated as if a + close(2) call had been done first. + +RREETTUURRNN VVAALLUUEESS + The value -1 is returned if an error occurs in either call. The external + variable _e_r_r_n_o indicates the cause of the error. + +EERRRROORRSS + DDuupp() and dduupp22() fail if: + + [EBADF] _O_l_d_d or _n_e_w_d is not a valid active descriptor + + [EMFILE] Too many descriptors are active. + +SSEEEE AALLSSOO + accept(2), open(2), close(2), fcntl(2), pipe(2), socket(2), + socketpair(2), getdtablesize(2) + +SSTTAANNDDAARRDDSS + DDuupp() and dduupp22() are expected to conform to IEEE Std 1003.1-1988 + (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/dup2.0 b/usr/share/man/cat2/dup2.0 new file mode 100644 index 0000000000..c1360d16cf --- /dev/null +++ b/usr/share/man/cat2/dup2.0 @@ -0,0 +1,55 @@ +DUP(2) BSD Programmer's Manual DUP(2) + +NNAAMMEE + dduupp, dduupp22 - duplicate an existing file descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + dduupp(_i_n_t _o_l_d_d); + + _i_n_t + dduupp22(_i_n_t _o_l_d_d, _i_n_t _n_e_w_d); + +DDEESSCCRRIIPPTTIIOONN + DDuupp() duplicates an existing object descriptor and returns its value to + the calling process (_n_e_w_d = dduupp(_o_l_d_d)). The argument _o_l_d_d is a small non- + negative integer index in the per-process descriptor table. The value + must be less than the size of the table, which is returned by + getdtablesize(2). The new descriptor returned by the call is the lowest + numbered descriptor currently not in use by the process. + + The object referenced by the descriptor does not distinguish between _o_l_d_d + and _n_e_w_d in any way. Thus if _n_e_w_d and _o_l_d_d are duplicate references to + an open file, read(2), write(2) and lseek(2) calls all move a single + pointer into the file, and append mode, non-blocking I/O and asynchronous + I/O options are shared between the references. If a separate pointer in- + to the file is desired, a different object reference to the file must be + obtained by issuing an additional open(2) call. The close-on-exec flag + on the new file descriptor is unset. + + In dduupp22(), the value of the new descriptor _n_e_w_d is specified. If this + descriptor is already in use, the descriptor is first deallocated as if a + close(2) call had been done first. + +RREETTUURRNN VVAALLUUEESS + The value -1 is returned if an error occurs in either call. The external + variable _e_r_r_n_o indicates the cause of the error. + +EERRRROORRSS + DDuupp() and dduupp22() fail if: + + [EBADF] _O_l_d_d or _n_e_w_d is not a valid active descriptor + + [EMFILE] Too many descriptors are active. + +SSEEEE AALLSSOO + accept(2), open(2), close(2), fcntl(2), pipe(2), socket(2), + socketpair(2), getdtablesize(2) + +SSTTAANNDDAARRDDSS + DDuupp() and dduupp22() are expected to conform to IEEE Std 1003.1-1988 + (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/errno.0 b/usr/share/man/cat2/errno.0 new file mode 100644 index 0000000000..ebfeb667d3 --- /dev/null +++ b/usr/share/man/cat2/errno.0 @@ -0,0 +1,550 @@ +INTRO(2) BSD Programmer's Manual INTRO(2) + +NNAAMMEE + iinnttrroo - introduction to system calls and error numbers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + +DDEESSCCRRIIPPTTIIOONN + This section provides an overview of the system calls, their error re- + turns, and other common definitions and concepts. + +DDIIAAGGNNOOSSTTIICCSS + Nearly all of the system calls provide an error number in the external + variable _e_r_r_n_o, which is defined as: + + extern int errno + + When a system call detects an error, it returns an integer value indicat- + ing failure (usually -1) and sets the variable _e_r_r_n_o accordingly. Successful calls never set _e_r_r_n_o; once set, it remains un- + til another error occurs. It should only be examined after an error. + Note that a number of system calls overload the meanings of these error + numbers, and that the meanings must be interpreted according to the type + and circumstances of the call. + + The following is a complete list of the errors and their names as given + in <_s_y_s_/_e_r_r_n_o_._h>. + + 0 _E_r_r_o_r _0. Not used. + + 1 EPERM _O_p_e_r_a_t_i_o_n _n_o_t _p_e_r_m_i_t_t_e_d _. An attempt was made to perform an oper- + ation limited to processes with appropriate privileges or to the + owner of a file or other resources. + + 2 ENOENT _N_o _s_u_c_h _f_i_l_e _o_r _d_i_r_e_c_t_o_r_y. A component of a specified pathname + did not exist, or the pathname was an empty string. + + 3 ESRCH _N_o _s_u_c_h _p_r_o_c_e_s_s. No process could be found corresponding to that + specified by the given process ID. + + 4 EINTR _I_n_t_e_r_r_u_p_t_e_d _f_u_n_c_t_i_o_n _c_a_l_l. An asynchronous signal (such as SIGINT + or SIGQUIT) was caught by the process during the execution of an + interruptible function. If the signal handler performs a normal + return, the interrupted function call will seem to have returned + the error condition. + + 5 EIO _I_n_p_u_t_/_o_u_t_p_u_t _e_r_r_o_r. Some physical input or output error occurred. + This error not be reported until a subsequent operation on the + same file descriptor and may be lost (over written) by any subse- + quent errors. + + 6 ENXIO _N_o _s_u_c_h _d_e_v_i_c_e _o_r _a_d_d_r_e_s_s. Input or output on a special file re- + ferred to a device that did not exist, or made a request beyond + the limits of the device. This error may also occur when, for + example, a tape drive is not online or no disk pack is is loaded + on a drive. + + 7 E2BIG _A_r_g _l_i_s_t _t_o_o _l_o_n_g. The number of bytes used for the argument and + environment list of the new process exceeded the current limit of + 20480 bytes (NCARGS in <_s_y_s_/_p_a_r_a_m_._h>). + + 8 ENOEXEC _E_x_e_c _f_o_r_m_a_t _e_r_r_o_r. A request was made to execute a file that, + although it has the appropriate permissions, was not in the for- + + mat required for an executable file. + + 9 EBADF _B_a_d _f_i_l_e _d_e_s_c_r_i_p_t_o_r. A file descriptor argument was out of range, + referred to no open file, or a read (write) request was made to a + file that was only open for writing (reading). + + 10 ECHILD _N_o _c_h_i_l_d _p_r_o_c_e_s_s_e_s. A wait or waitpid function was executed by + a process that had no existing or unwaited-for child processes. + + 11 EDEADLK _R_e_s_o_u_r_c_e _d_e_a_d_l_o_c_k _a_v_o_i_d_e_d. An attempt was made to lock a sys- + tem resource that would have resulted in a deadlock situation. + + 12 ENOMEM _C_a_n_n_o_t _a_l_l_o_c_a_t_e _m_e_m_o_r_y. The new process image required more + memory than was allowed by the hardware or by system-imposed mem- + ory management constraints. A lack of swap space is normally + temporary; however, a lack of core is not. Soft limits may be + increased to their corresponding hard limits. + + 13 EACCES _P_e_r_m_i_s_s_i_o_n _d_e_n_i_e_d. An attempt was made to access a file in a + way forbidden by its file access permissions. + + 14 EFAULT _B_a_d _a_d_d_r_e_s_s. The system detected an invalid address in attempt- + ing to use an argument of a call. + + 15 ENOTBLK _N_o_t _a _b_l_o_c_k _d_e_v_i_c_e. A block device operation was attempted on + a non-block device or file. + + 16 EBUSY _R_e_s_o_u_r_c_e _b_u_s_y. An attempt to use a system resource which was in + use at the time in a manner which would have conflicted with the + request. + + 17 EEXIST _F_i_l_e _e_x_i_s_t_s. An existing file was mentioned in an inappropriate + context, for instance, as the new link name in a link function. + + 18 EXDEV _I_m_p_r_o_p_e_r _l_i_n_k. A hard link to a file on another file system was + attempted. + + 19 ENODEV _O_p_e_r_a_t_i_o_n _n_o_t _s_u_p_p_o_r_t_e_d _b_y _d_e_v_i_c_e. An attempt was made to apply + an inappropriate function to a device, for example, trying to + read a write-only device such as a printer. + + 20 ENOTDIR _N_o_t _a _d_i_r_e_c_t_o_r_y. A component of the specified pathname exist- + ed, but it was not a directory, when a directory was expected. + + 21 EISDIR _I_s _a _d_i_r_e_c_t_o_r_y. An attempt was made to open a directory with + write mode specified. + + 22 EINVAL _I_n_v_a_l_i_d _a_r_g_u_m_e_n_t. Some invalid argument was supplied. (For ex- + ample, specifying an undefined signal to a signal or kill func- + tion). + + 23 ENFILE _T_o_o _m_a_n_y _o_p_e_n _f_i_l_e_s _i_n _s_y_s_t_e_m. Maximum number of file descrip- + tors allowable on the system has been reached and a requests for + an open cannot be satisfied until at least one has been closed. + + 24 EMFILE _T_o_o _m_a_n_y _o_p_e_n _f_i_l_e_s. Getdtablesize(2) will obtain the + current limit. + + 25 ENOTTY _I_n_a_p_p_r_o_p_r_i_a_t_e _i_o_c_t_l _f_o_r _d_e_v_i_c_e. A control function (see + ioctl(2)) was attempted for a file or special device for which + the operation was inappropriate. + + 26 ETXTBSY _T_e_x_t _f_i_l_e _b_u_s_y. The new process was a pure procedure (shared + text) file which was open for writing by another process, or the + pure procedure file was being executed an open call requested + write access. + + 27 EFBIG _F_i_l_e _t_o_o _l_a_r_g_e. The size of a file exceeded the maximum (about + 2.1E9 bytes). + + 28 ENOSPC _D_e_v_i_c_e _o_u_t _o_f _s_p_a_c_e. A write to an ordinary file, the creation + of a directory or symbolic link, or the creation of a directory + entry failed because no more disk blocks are available on the + file system, or the allocation of an inode for a newly created + file failed because no more inodes are available on the file sys- + tem. + + 29 ESPIPE _I_l_l_e_g_a_l _s_e_e_k. An lseek function was issued on a socket, pipe or + FIFO. + + 30 EROFS _R_e_a_d_-_o_n_l_y _f_i_l_e _s_y_s_t_e_m. An attempt was made to modify a file or + directory was made on a file system that was read-only at the + time. + + 31 EMLINK _T_o_o _m_a_n_y _l_i_n_k_s. Maximum allowable hard links to a single file + has been exceeded (limit of 32767 hard links per file). + + 32 EPIPE _B_r_o_k_e_n _p_i_p_e. A write on a pipe, socket or FIFO for which there + is no process to read the data. + + 33 EDOM _N_u_m_e_r_i_c_a_l _a_r_g_u_m_e_n_t _o_u_t _o_f _d_o_m_a_i_n. A numerical input argument was + outside the defined domain of the mathematical function. + + 34 ERANGE _N_u_m_e_r_i_c_a_l _r_e_s_u_l_t _o_u_t _o_f _r_a_n_g_e. A numerical result of the func- + tion was to large to fit in the available space (perhaps exceeded + precision). + + 35 EAGAIN _R_e_s_o_u_r_c_e _t_e_m_p_o_r_a_r_i_l_y _u_n_a_v_a_i_l_a_b_l_e. This is a temporary condition + and later calls to the same routine may complete normally. + + 36 EINPROGRESS _O_p_e_r_a_t_i_o_n _n_o_w _i_n _p_r_o_g_r_e_s_s. An operation that takes a long + time to complete (such as a connect(2)) was attempted on a non- + blocking object (see fcntl(2)). + + 37 EALREADY _O_p_e_r_a_t_i_o_n _a_l_r_e_a_d_y _i_n _p_r_o_g_r_e_s_s. An operation was attempted on + a non-blocking object that already had an operation in progress. + + 38 ENOTSOCK _S_o_c_k_e_t _o_p_e_r_a_t_i_o_n _o_n _n_o_n_-_s_o_c_k_e_t. Self-explanatory. + + 39 EDESTADDRREQ _D_e_s_t_i_n_a_t_i_o_n _a_d_d_r_e_s_s _r_e_q_u_i_r_e_d. A required address was + omitted from an operation on a socket. + + 40 EMSGSIZE _M_e_s_s_a_g_e _t_o_o _l_o_n_g. A message sent on a socket was larger than + the internal message buffer or some other network limit. + + 41 EPROTOTYPE _P_r_o_t_o_c_o_l _w_r_o_n_g _t_y_p_e _f_o_r _s_o_c_k_e_t. A protocol was specified + that does not support the semantics of the socket type requested. + For example, you cannot use the ARPA Internet UDP protocol with + type SOCK_STREAM. + + 42 ENOPROTOOPT _P_r_o_t_o_c_o_l _n_o_t _a_v_a_i_l_a_b_l_e. A bad option or level was speci- + fied in a getsockopt(2) or setsockopt(2) call. + + 43 EPROTONOSUPPORT _P_r_o_t_o_c_o_l _n_o_t _s_u_p_p_o_r_t_e_d. The protocol has not been con- + figured into the system or no implementation for it exists. + + 44 ESOCKTNOSUPPORT _S_o_c_k_e_t _t_y_p_e _n_o_t _s_u_p_p_o_r_t_e_d. The support for the socket + type has not been configured into the system or no implementation + + + for it exists. + + 45 EOPNOTSUPP _O_p_e_r_a_t_i_o_n _n_o_t _s_u_p_p_o_r_t_e_d. The attempted operation is not + supported for the type of object referenced. Usually this occurs + when a file descriptor refers to a file or socket that cannot + support this operation, for example, trying to _a_c_c_e_p_t a connec- + tion on a datagram socket. + + 46 EPFNOSUPPORT _P_r_o_t_o_c_o_l _f_a_m_i_l_y _n_o_t _s_u_p_p_o_r_t_e_d. The protocol family has + not been configured into the system or no implementation for it + exists. + + 47 EAFNOSUPPORT _A_d_d_r_e_s_s _f_a_m_i_l_y _n_o_t _s_u_p_p_o_r_t_e_d _b_y _p_r_o_t_o_c_o_l _f_a_m_i_l_y. An ad- + dress incompatible with the requested protocol was used. For ex- + ample, you shouldn't necessarily expect to be able to use NS ad- + dresses with ARPA Internet protocols. + + 48 EADDRINUSE _A_d_d_r_e_s_s _a_l_r_e_a_d_y _i_n _u_s_e. Only one usage of each address is + normally permitted. + + 49 EADDRNOTAVAIL _C_a_n_n_o_t _a_s_s_i_g_n _r_e_q_u_e_s_t_e_d _a_d_d_r_e_s_s. Normally results from + an attempt to create a socket with an address not on this ma- + chine. + + 50 ENETDOWN _N_e_t_w_o_r_k _i_s _d_o_w_n. A socket operation encountered a dead net- + work. + + 51 ENETUNREACH _N_e_t_w_o_r_k _i_s _u_n_r_e_a_c_h_a_b_l_e. A socket operation was attempted + to an unreachable network. + + 52 ENETRESET _N_e_t_w_o_r_k _d_r_o_p_p_e_d _c_o_n_n_e_c_t_i_o_n _o_n _r_e_s_e_t. The host you were con- + nected to crashed and rebooted. + + 53 ECONNABORTED _S_o_f_t_w_a_r_e _c_a_u_s_e_d _c_o_n_n_e_c_t_i_o_n _a_b_o_r_t. A connection abort was + caused internal to your host machine. + + 54 ECONNRESET _C_o_n_n_e_c_t_i_o_n _r_e_s_e_t _b_y _p_e_e_r. A connection was forcibly closed + by a peer. This normally results from a loss of the connection + on the remote socket due to a timeout or a reboot. + + 55 ENOBUFS _N_o _b_u_f_f_e_r _s_p_a_c_e _a_v_a_i_l_a_b_l_e. An operation on a socket or pipe + was not performed because the system lacked sufficient buffer + space or because a queue was full. + + 56 EISCONN _S_o_c_k_e_t _i_s _a_l_r_e_a_d_y _c_o_n_n_e_c_t_e_d. A connect request was made on an + already connected socket; or, a sendto or sendmsg request on a + connected socket specified a destination when already connected. + + 57 ENOTCONN _S_o_c_k_e_t _i_s _n_o_t _c_o_n_n_e_c_t_e_d. An request to send or receive data + was disallowed because the socket is not connected and (when + sending on a datagram socket) no address was supplied. + + 58 ESHUTDOWN _C_a_n_n_o_t _s_e_n_d _a_f_t_e_r _s_o_c_k_e_t _s_h_u_t_d_o_w_n. A request to send data + was disallowed because the socket had already been shut down with + a previous shutdown(2) call. + + 60 ETIMEDOUT _C_o_n_n_e_c_t_i_o_n _t_i_m_e_d _o_u_t. A connect or send request failed be- + cause the connected party did not properly respond after a period + of time. (The timeout period is dependent on the communication + protocol.) + + 61 ECONNREFUSED _C_o_n_n_e_c_t_i_o_n _r_e_f_u_s_e_d. No connection could be made because + the target machine actively refused it. This usually results + from trying to connect to a service that is inactive on the for- + + + eign host. + + 62 ELOOP _T_o_o _m_a_n_y _l_e_v_e_l_s _o_f _s_y_m_b_o_l_i_c _l_i_n_k_s. A path name lookup involved + more than 8 symbolic links. + + 63 ENAMETOOLONG _F_i_l_e _n_a_m_e _t_o_o _l_o_n_g. A component of a path name exceeded + 255 (MAXNAMELEN) characters, or an entire path name exceeded 1023 + (MAXPATHLEN-1) characters. + + 64 EHOSTDOWN _H_o_s_t _i_s _d_o_w_n. A socket operation failed because the destina- + tion host was down. + + 65 EHOSTUNREACH _N_o _r_o_u_t_e _t_o _h_o_s_t. A socket operation was attempted to an + unreachable host. + + 66 ENOTEMPTY _D_i_r_e_c_t_o_r_y _n_o_t _e_m_p_t_y. A directory with entries other than `.' + and `..' was supplied to a remove directory or rename call. + + 67 EPROCLIM _T_o_o _m_a_n_y _p_r_o_c_e_s_s_e_s. + + 68 EUSERS _T_o_o _m_a_n_y _u_s_e_r_s. The quota system ran out of table entries. + + 69 EDQUOT _D_i_s_c _q_u_o_t_a _e_x_c_e_e_d_e_d. A write to an ordinary file, the creation + of a directory or symbolic link, or the creation of a directory + entry failed because the user's quota of disk blocks was exhaust- + ed, or the allocation of an inode for a newly created file failed + because the user's quota of inodes was exhausted. + + 70 ESTALE _S_t_a_l_e _N_F_S _f_i_l_e _h_a_n_d_l_e. An attempt was made to access an open + file (on an NFS filesystem) which is now unavailable as refer- + enced by the file descriptor. This may indicate the file was + deleted on the NFS server or some other catastrophic event oc- + curred. + + 72 EBADRPC _R_P_C _s_t_r_u_c_t _i_s _b_a_d. Exchange of RPC information was unsuccess- + ful. + + 73 ERPCMISMATCH _R_P_C _v_e_r_s_i_o_n _w_r_o_n_g. The version of RPC on the remote peer + is not compatible with the local version. + + 74 EPROGUNAVAIL _R_P_C _p_r_o_g_. _n_o_t _a_v_a_i_l. The requested program is not regis- + tered on the remote host. + + 75 EPROGMISMATCH _P_r_o_g_r_a_m _v_e_r_s_i_o_n _w_r_o_n_g. The requested version of the pro- + gram is not available on the remote host (RPC). + + 76 EPROCUNAVAIL _B_a_d _p_r_o_c_e_d_u_r_e _f_o_r _p_r_o_g_r_a_m. An RPC call was attempted for + a procedure which doesn't exist in the remote program. + + 77 ENOLCK _N_o _l_o_c_k_s _a_v_a_i_l_a_b_l_e. A system-imposed limit on the number of si- + multaneous file locks was reached. + + 78 ENOSYS _F_u_n_c_t_i_o_n _n_o_t _i_m_p_l_e_m_e_n_t_e_d. Attempted a system call that is not + available on this system. + +DDEEFFIINNIITTIIOONNSS + Process ID. + Each active process in the system is uniquely identified by a + non-negative integer called a process ID. The range of this ID + is from 0 to 30000. + + Parent process ID + A new process is created by a currently active process; (see + fork(2)). The parent process ID of a process is initially the + process ID of its creator. If the creating process exits, the + parent process ID of each child is set to the ID of a system pro- + + cess, init. + + Process Group + Each active process is a member of a process group that is iden- + tified by a non-negative integer called the process group ID. + This is the process ID of the group leader. This grouping per- + mits the signaling of related processes (see termios(4)) and the + job control mechanisms of csh(1). + + Session + A session is a set of one or more process groups. A session is + created by a successful call to setsid(2), which causes the + caller to become the only member of the only process group in the + new session. + + Session leader + A process that has created a new session by a successful call to + setsid(2), is known as a session leader. Only a session leader + may acquire a terminal as its controlling terminal (see + termios(4)). + + Controlling process + A session leader with a controlling terminal is a controlling + process. + + Controlling terminal + A terminal that is associated with a session is known as the con- + trolling terminal for that session and its members. + + Terminal Process Group ID + A terminal may be acquired by a session leader as its controlling + terminal. Once a terminal is associated with a session, any of + the process groups within the session may be placed into the + foreground by setting the terminal process group ID to the ID of + the process group. This facility is used to arbitrate between + multiple jobs contending for the same terminal; (see csh(1) and + tty(4)). + + Orphaned Process Group + A process group is considered to be _o_r_p_h_a_n_e_d if it is not under + the control of a job control shell. More precisely, a process + group is orphaned when none of its members has a parent process + that is in the same session as the group, but is in a different + process group. Note that when a process exits, the parent pro- + cess for its children is changed to be init, which is in a sepa- + rate session. Not all members of an orphaned process group are + necessarily orphaned processes (those whose creating process has + exited). The process group of a session leader is orphaned by + definition. + + Real User ID and Real Group ID + Each user on the system is identified by a positive integer + termed the real user ID. + + Each user is also a member of one or more groups. One of these + groups is distinguished from others and used in implementing ac- + counting facilities. The positive integer corresponding to this + distinguished group is termed the real group ID. + + All processes have a real user ID and real group ID. These are + initialized from the equivalent attributes of the process that + created it. + + Effective User Id, Effective Group Id, and Group Access List + Access to system resources is governed by two values: the effec- + tive user ID, and the group access list. The first member of the + group access list is also known as the effective group ID. (In + POSIX.1, the group access list is known as the set of supplemen- + tary group IDs, and it is unspecified whether the effective group + ID is a member of the list.) + + The effective user ID and effective group ID are initially the + process's real user ID and real group ID respectively. Either + may be modified through execution of a set-user-ID or set-group- + ID file (possibly by one its ancestors) (see execve(2)). By con- + vention, the effective group ID (the first member of the group + access list) is duplicated, so that the execution of a set-group- + ID program does not result in the loss of the original (real) + group ID. + + The group access list is a set of group IDs used only in deter- + mining resource accessibility. Access checks are performed as + described below in ``File Access Permissions''. + + Saved Set User ID and Saved Set Group ID + When a process executes a new file, the effective user ID is set + to the owner of the file if the file is set-user-ID, and the ef- + fective group ID (first element of the group access list) is set + to the group of the file if the file is set-group-ID. The effec- + tive user ID of the process is then recorded as the saved set- + user-ID, and the effective group ID of the process is recorded as + the saved set-group-ID. These values may be used to regain those + values as the effective user or group ID after reverting to the + real ID (see setuid(2)). (In POSIX.1, the saved set-user-ID and + saved set-group-ID are optional, and are used in setuid and set- + gid, but this does not work as desired for the super-user.) + + Super-user + A process is recognized as a _s_u_p_e_r_-_u_s_e_r process and is granted + special privileges if its effective user ID is 0. + + Special Processes + The processes with process IDs of 0, 1, and 2 are special. Pro- + cess 0 is the scheduler. Process 1 is the initialization process + init, and is the ancestor of every other process in the system. + It is used to control the process structure. Process 2 is the + paging daemon. + + Descriptor + An integer assigned by the system when a file is referenced by + open(2) or dup(2), or when a socket is created by pipe(2), + socket(2) or socketpair(2), which uniquely identifies an access + path to that file or socket from a given process or any of its + children. + + File Name + Names consisting of up to 255 (MAXNAMELEN) characters may be used + to name an ordinary file, special file, or directory. + + These characters may be selected from the set of all ASCII char- + acter excluding 0 (NUL) and the ASCII code for `/' (slash). (The + parity bit, bit 7, must be 0.) + + Note that it is generally unwise to use `*', `?', `[' or `]' as + part of file names because of the special meaning attached to + these characters by the shell. + + Path Name + A path name is a NUL-terminated character string starting with an + optional slash `/', followed by zero or more directory names sep- + arated by slashes, optionally followed by a file name. The total + length of a path name must be less than 1024 (MAXPATHLEN) charac- + ters. + + If a path name begins with a slash, the path search begins at the + _r_o_o_t directory. Otherwise, the search begins from the current + working directory. A slash by itself names the root directory. + An empty pathname refers to the current directory. + + Directory + A directory is a special type of file that contains entries that + are references to other files. Directory entries are called + links. By convention, a directory contains at least two links, + `.' and `..', referred to as _d_o_t and _d_o_t_-_d_o_t respectively. Dot + refers to the directory itself and dot-dot refers to its parent + directory. + + Root Directory and Current Working Directory + Each process has associated with it a concept of a root directory + and a current working directory for the purpose of resolving path + name searches. A process's root directory need not be the root + directory of the root file system. + + File Access Permissions + Every file in the file system has a set of access permissions. + These permissions are used in determining whether a process may + perform a requested operation on the file (such as opening a file + for writing). Access permissions are established at the time a + file is created. They may be changed at some later time through + the chmod(2) call. + + File access is broken down according to whether a file may be: + read, written, or executed. Directory files use the execute per- + mission to control if the directory may be searched. + + File access permissions are interpreted by the system as they ap- + ply to three different classes of users: the owner of the file, + those users in the file's group, anyone else. Every file has an + independent set of access permissions for each of these classes. + When an access check is made, the system decides if permission + should be granted by checking the access information applicable + to the caller. + + Read, write, and execute/search permissions on a file are granted + to a process if: + + The process's effective user ID is that of the super-user. (Note: + even the super-user cannot execute a non-executable file.) + + The process's effective user ID matches the user ID of the owner + of the file and the owner permissions allow the access. + + The process's effective user ID does not match the user ID of the + owner of the file, and either the process's effective group ID + matches the group ID of the file, or the group ID of the file is + in the process's group access list, and the group permissions al- + low the access. + + Neither the effective user ID nor effective group ID and group + access list of the process match the corresponding user ID and + group ID of the file, but the permissions for ``other users'' al- + low access. + + Otherwise, permission is denied. + + Sockets and Address Families + + + A socket is an endpoint for communication between processes. + Each socket has queues for sending and receiving data. + + Sockets are typed according to their communications properties. + These properties include whether messages sent and received at a + socket require the name of the partner, whether communication is + reliable, the format used in naming message recipients, etc. + + Each instance of the system supports some collection of socket + types; consult socket(2) for more information about the types + available and their properties. + + Each instance of the system supports some number of sets of com- + munications protocols. Each protocol set supports addresses of a + certain format. An Address Family is the set of addresses for a + specific group of protocols. Each socket has an address chosen + from the address family in which the socket was created. + +SSEEEE AALLSSOO + intro(3), perror(3) + +4th Berkeley Distribution June 4, 1993 9 diff --git a/usr/share/man/cat2/execve.0 b/usr/share/man/cat2/execve.0 new file mode 100644 index 0000000000..bdd900ce42 --- /dev/null +++ b/usr/share/man/cat2/execve.0 @@ -0,0 +1,164 @@ +EXECVE(2) BSD Programmer's Manual EXECVE(2) + +NNAAMMEE + eexxeeccvvee - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + eexxeeccvvee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _* _c_h_a_r _*_a_r_g_v, _c_o_n_s_t _* _c_h_a_r _*_e_n_v_p); + +DDEESSCCRRIIPPTTIIOONN + EExxeeccvvee() transforms the calling process into a new process. The new pro- + cess is constructed from an ordinary file, whose name is pointed to by + _p_a_t_h, called the _n_e_w _p_r_o_c_e_s_s _f_i_l_e. This file is either an executable ob- + ject file, or a file of data for an interpreter. An executable object + file consists of an identifying header, followed by pages of data repre- + senting the initial program (text) and initialized data pages. Addition- + al pages may be specified by the header to be initialized with zero data; + see a.out(5). + + An interpreter file begins with a line of the form: + + ##!! _i_n_t_e_r_p_r_e_t_e_r [_a_r_g] + + When an interpreter file is eexxeeccvvee(_A_p, _d), the system eexxeeccvvee(_A_p, _s) the + specified _i_n_t_e_r_p_r_e_t_e_r. If the optional _a_r_g is specified, it becomes the + first argument to the _i_n_t_e_r_p_r_e_t_e_r, and the name of the originally + eexxeeccvvee(_A_p, _d) file becomes the second argument; otherwise, the name of + the originally eexxeeccvvee(_A_p, _d) file becomes the first argument. The origi- + nal arguments are shifted over to become the subsequent arguments. The + zeroth argument, normally the name of the eexxeeccvvee(_A_p, _d) file, is left un- + changed. + + The argument _a_r_g_v is a pointer to a null-terminated array of character + pointers to null-terminated character strings. These strings construct + the argument list to be made available to the new process. At least one + argument must be present in the array; by custom, the first element + should be the name of the executed program (for example, the last compo- + nent of _p_a_t_h). + + The argument _e_n_v_p is also a pointer to a null-terminated array of charac- + ter pointers to null-terminated strings. A pointer to this array is nor- + mally stored in the global variable _e_n_v_i_r_o_n_. These strings pass informa- + tion to the new process that is not directly an argument to the command + (see environ(7)). + + File descriptors open in the calling process image remain open in the new + process image, except for those for which the close-on-exec flag is set + (see close(2) and fcntl(2)). Descriptors that remain open are unaffected + by eexxeeccvvee(). + + Signals set to be ignored in the calling process are set to be ignored in + the new process. Signals which are set to be caught in the calling pro- + cess image are set to default action in the new process image. Blocked + signals remain blocked regardless of changes to the signal action. The + signal stack is reset to be undefined (see sigaction(2) for more informa- + tion). + + If the set-user-ID mode bit of the new process image file is set (see + chmod(2)), the effective user ID of the new process image is set to the + owner ID of the new process image file. If the set-group-ID mode bit of + the new process image file is set, the effective group ID of the new pro- + cess image is set to the group ID of the new process image file. (The + effective group ID is the first element of the group list.) The real us- + er ID, real group ID and other group IDs of the new process image remain + the same as the calling process image. After any set-user-ID and set- + group-ID processing, the effective user ID is recorded as the saved set- + user-ID, and the effective group ID is recorded as the saved set-group- + ID. These values may be used in changing the effective IDs later (see + setuid(2)). + + The new process also inherits the following attributes from the calling + process: + + process ID see getpid(2) + parent process ID see getppid(2) + process group ID see getpgrp(2) + access groups see getgroups(2) + working directory see chdir(2) + root directory see chroot(2) + control terminal see termios(4) + resource usages see getrusage(2) + interval timers see getitimer(2) + resource limits see getrlimit(2) + file mode mask see umask(2) + signal mask see sigvec(2), sigsetmask(2) + + When a program is executed as a result of an eexxeeccvvee() call, it is entered + as follows: + + main(argc, argv, envp) + int argc; + char **argv, **envp; + + where _a_r_g_c is the number of elements in _a_r_g_v (the ``arg count'') and _a_r_g_v + points to the array of character pointers to the arguments themselves. + +RREETTUURRNN VVAALLUUEESS + As the eexxeeccvvee() function overlays the current process image with a new + process image the successful call has no process to return to. If + eexxeeccvvee() does return to the calling process an error has occurred; the + return value will be -1 and the global variable _e_r_r_n_o is set to indicate + the error. + +EERRRROORRSS + EExxeeccvvee() will fail and return to the calling process if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The new process file does not exist. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [EACCES] The new process file is not an ordinary file. + + [EACCES] The new process file mode denies execute permission. + + [ENOEXEC] The new process file has the appropriate access permis- + + + sion, but has an invalid magic number in its header. + + [ETXTBSY] The new process file is a pure procedure (shared text) + file that is currently open for writing or reading by + some process. + + [ENOMEM] The new process requires more virtual memory than is al- + lowed by the imposed maximum (getrlimit(2)). + + [E2BIG] The number of bytes in the new process's argument list is + larger than the system-imposed limit. The limit in the + system as released is 20480 bytes (NCARGS in + <_s_y_s_/_p_a_r_a_m_._h>. + + [EFAULT] The new process file is not as long as indicated by the + size values in its header. + + [EFAULT] _P_a_t_h, _a_r_g_v, or _e_n_v_p point to an illegal address. + + [EIO] An I/O error occurred while reading from the file system. + +CCAAVVEEAATT + If a program is _s_e_t_u_i_d to a non-super-user, but is executed when the real + _u_i_d is ``root'', then the program has some of the powers of a super-user + as well. + +SSEEEE AALLSSOO + exit(2), fork(2), execl(3), environ(7) + +HHIISSTTOORRYY + The eexxeeccvvee function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/fchdir.0 b/usr/share/man/cat2/fchdir.0 new file mode 100644 index 0000000000..b742384588 --- /dev/null +++ b/usr/share/man/cat2/fchdir.0 @@ -0,0 +1,79 @@ +CHDIR(2) BSD Programmer's Manual CHDIR(2) + +NNAAMMEE + cchhddiirr, ffcchhddiirr - change current working directory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhddiirr(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); + + _i_n_t + ffcchhddiirr(_i_n_t _f_d); + +DDEESSCCRRIIPPTTIIOONN + The _p_a_t_h arument points to the pathname of a directory. The cchhddiirr() + function causes the named directory to become the current working direc- + tory, that is, the starting point for path searches of pathnames not be- + ginning with a slash, `/'. + + The ffcchhddiirr() function causes the directory referenced by _f_d to become the + current working directory, the starting point for path searches of path- + names not beginning with a slash, `/'. + + In order for a directory to become the current directory, a process must + have execute (search) access to the directory. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhddiirr() will fail and the current working directory will be unchanged if + one or more of the following are true: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named directory does not exist. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EACCES] Search permission is denied for any component of the path + name. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhddiirr() will fail and the current working directory will be unchanged if + one or more of the following are true: + + [EACCES] Search permission is denied for the directory referenced by + the file descriptor. + + + + [ENOTDIR] The file descriptor does not reference a directory. + + [EBADF] The argument _f_d is not a valid file descriptor. + +SSEEEE AALLSSOO + chroot(2) + +SSTTAANNDDAARRDDSS + CChhddiirr() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhddiirr() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/fchflags.0 b/usr/share/man/cat2/fchflags.0 new file mode 100644 index 0000000000..46217eadaf --- /dev/null +++ b/usr/share/man/cat2/fchflags.0 @@ -0,0 +1,90 @@ +CHFLAGS(2) BSD Programmer's Manual CHFLAGS(2) + +NNAAMMEE + cchhffllaaggss, ffcchhffllaaggss - set file flags + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + cchhffllaaggss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _u___l_o_n_g _f_l_a_g_s); + + _i_n_t + ffcchhffllaaggss(_i_n_t _f_d, _u___l_o_n_g _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The file whose name is given by _p_a_t_h or referenced by the descriptor _f_d + has its flags changed to _f_l_a_g_s. + + The flags specified are formed by _o_r'ing the following values + + UF_NODUMP Do not dump the file. + UF_IMMUTABLE The file may not be changed. + UF_APPEND The file may only be appended to. + SF_IMMUTABLE The file may not be changed. + SF_APPEND The file may only be appended to. + + The ``UF_IMMUTABLE'' and ``UF_APPEND'' flags may be set or unset by ei- + ther the owner of a file or the super-user. + + The ``SF_IMMUTABLE'' and ``SF_APPEND'' flags may only be set or unset by + the super-user. They may be set at any time, but normally may only be + unset when the system is in single-user mode. (See init(8) for details.) + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhffllaaggss() will fail it: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhffllaaggss() will fail if: + + [EBADF] The descriptor is not valid. + + [EINVAL] _F_d refers to a socket, not to a file. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chflags(1,) init(8) + +HHIISSTTOORRYY + The cchhffllaaggss and ffcchhffllaaggss functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/fchmod.0 b/usr/share/man/cat2/fchmod.0 new file mode 100644 index 0000000000..997765e9f8 --- /dev/null +++ b/usr/share/man/cat2/fchmod.0 @@ -0,0 +1,113 @@ +CHMOD(2) BSD Programmer's Manual CHMOD(2) + +NNAAMMEE + cchhmmoodd, ffcchhmmoodd - change mode of file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhmmoodd(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e); + + _i_n_t + ffcchhmmoodd(_i_n_t _f_d, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + The function cchhmmoodd() sets the file permission bits of the file specified + by the pathname _p_a_t_h to _m_o_d_e. FFcchhmmoodd() sets the permission bits of the + specified file descriptor _f_d. CChhmmoodd() verifies that the process owner + (user) either owns the file specified by _p_a_t_h (or _f_d), or is the super- + user. A mode is created from _o_r _A_p _d permission bit masks defined in + <_s_y_s_/_s_t_a_t_._h>: + #define S_IRWXU 0000700 /* RWX mask for owner */ + #define S_IRUSR 0000400 /* R for owner */ + #define S_IWUSR 0000200 /* W for owner */ + #define S_IXUSR 0000100 /* X for owner */ + + #define S_IRWXG 0000070 /* RWX mask for group */ + #define S_IRGRP 0000040 /* R for group */ + #define S_IWGRP 0000020 /* W for group */ + #define S_IXGRP 0000010 /* X for group */ + + #define S_IRWXO 0000007 /* RWX mask for other */ + #define S_IROTH 0000004 /* R for other */ + #define S_IWOTH 0000002 /* W for other */ + #define S_IXOTH 0000001 /* X for other */ + + #define S_ISUID 0004000 /* set user id on execution */ + #define S_ISGID 0002000 /* set group id on execution */ + #define S_ISVTX 0001000 /* save swapped text even after use */ + + The ISVTX (the _s_t_i_c_k_y _b_i_t) indicates to the system which executable files + are shareable (the default) and the system maintains the program text of + the files in the swap area. The sticky bit may only be set by the super + user on shareable executable files. + + If mode ISVTX (the `sticky bit') is set on a directory, an unprivileged + user may not delete or rename files of other users in that directory. The + sticky bit may be set by any user on a directory which the user owns or + has appropriate permissions. For more details of the properties of the + sticky bit, see sticky(8). + + Writing or changing the owner of a file turns off the set-user-id and + set-group-id bits unless the user is the super-user. This makes the sys- + tem somewhat more secure by protecting set-user-id (set-group-id) files + from remaining set-user-id (set-group-id) if they are modified, at the + expense of a degree of compatibility. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + CChhmmoodd() will fail and the file mode will be unchanged if: + + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID does not match the owner of the file + and the effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhmmoodd() will fail if: + + [EBADF] The descriptor is not valid. + + [EINVAL] _F_d refers to a socket, not to a file. + + [EROFS] The file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chmod(1), open(2), chown(2), stat(2), sticky(8) + +SSTTAANNDDAARRDDSS + CChhmmoodd() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhmmoodd() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/fchown.0 b/usr/share/man/cat2/fchown.0 new file mode 100644 index 0000000000..907ce09f4f --- /dev/null +++ b/usr/share/man/cat2/fchown.0 @@ -0,0 +1,92 @@ +CHOWN(2) BSD Programmer's Manual CHOWN(2) + +NNAAMMEE + cchhoowwnn, ffcchhoowwnn - change owner and group of a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + cchhoowwnn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _u_i_d___t _o_w_n_e_r, _g_i_d___t _g_r_o_u_p); + + _i_n_t + ffcchhoowwnn(_i_n_t _f_d, _u_i_d___t _o_w_n_e_r, _u_i_d___t _g_r_o_u_p); + +DDEESSCCRRIIPPTTIIOONN + The owner ID and group ID of the file named by _p_a_t_h or referenced by _f_d + is changed as specified by the arguments _o_w_n_e_r and _g_r_o_u_p. The owner of a + file may change the _g_r_o_u_p to a group of which he or she is a member, but + the change _o_w_n_e_r capability is restricted to the super-user. + + CChhoowwnn() clears the set-user-id and set-group-id bits on the file to pre- + vent accidental or mischievious creation of set-user-id and set-group-id + programs. + + FFcchhoowwnn() is particularly useful when used in conjunction with the file + locking primitives (see flock(2)). + + One of the owner or group id's may be left unchanged by specifying it as + -1. + + If the final component of _p_a_t_h is a symbolic link, the ownership and + group of the symbolic link is changed, not the ownership and group of the + file or directory to which it points. + +RREETTUURRNN VVAALLUUEESS + Zero is returned if the operation was successful; -1 is returned if an + error occurs, with a more specific error code being placed in the global + variable _e_r_r_n_o. + +EERRRROORRSS + CChhoowwnn() will fail and the file will be unchanged if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFcchhoowwnn() will fail if: + + [EBADF] _F_d does not refer to a valid descriptor. + + [EINVAL] _F_d refers to a socket, not a file. + + [EPERM] The effective user ID is not the super-user. + + [EROFS] The named file resides on a read-only file system. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + chown(8), chgrp(1), chmod(2), flock(2) + +SSTTAANNDDAARRDDSS + CChhoowwnn() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ffcchhoowwnn() function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/fcntl.0 b/usr/share/man/cat2/fcntl.0 new file mode 100644 index 0000000000..e1887df0a4 --- /dev/null +++ b/usr/share/man/cat2/fcntl.0 @@ -0,0 +1,232 @@ +FCNTL(2) BSD Programmer's Manual FCNTL(2) + +NNAAMMEE + ffccnnttll - file control + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffccnnttll(_i_n_t _f_d, _i_n_t _c_m_d, _i_n_t _a_r_g); + +DDEESSCCRRIIPPTTIIOONN + FFccnnttll() provides for control over descriptors. The argument _f_d is a de- + scriptor to be operated on by _c_m_d as follows: + + F_DUPFD Return a new descriptor as follows: + + ++oo Lowest numbered available descriptor greater than or + equal to _a_r_g. + ++oo Same object references as the original descriptor. + ++oo New descriptor shares the same file offset if the ob- + ject was a file. + ++oo Same access mode (read, write or read/write). + ++oo Same file status flags (i.e., both file descriptors + share the same file status flags). + ++oo The close-on-exec flag associated with the new file + descriptor is set to remain open across execv(2) sys- + tem calls. + + F_GETFD Get the close-on-exec flag associated with the file descriptor + _f_d. If the low-order bit of the returned value is 0, the file + will remain open across eexxeecc(), otherwise the file will be + closed upon execution of eexxeecc() (_a_r_g is ignored). + + F_SETFD Set the close-on-exec flag associated with _f_d to the low order + bit of _a_r_g (0 or 1 as above). + + F_GETFL Get descriptor status flags, as described below (_a_r_g is ig- + nored). + + F_SETFL Set descriptor status flags to _a_r_g. + + F_GETOWN Get the process ID or process group currently receiving SIGIO + and SIGURG signals; process groups are returned as negative + values (_a_r_g is ignored). + + F_SETOWN Set the process or process group to receive SIGIO and SIGURG + signals; process groups are specified by supplying _a_r_g as neg- + ative, otherwise _a_r_g is interpreted as a process ID. + + The flags for the F_GETFL and F_SETFL flags are as follows: + + O_NONBLOCK Non-blocking I/O; if no data is available to a read call, or + if a write operation would block, the read or write call re- + turns -1 with the error EAGAIN. + + O_APPEND Force each write to append at the end of file; corresponds + to the O_APPEND flag of open(2). + + O_ASYNC Enable the SIGIO signal to be sent to the process group when + I/O is possible, e.g., upon availability of data to be read. + + Several commands are available for doing advisory file locking; they all + operate on the following structure: + + struct flock { + off_t l_start; /* starting offset */ + off_t l_len; /* len = 0 means until end of file */ + pid_t l_pid; /* lock owner */ + short l_type; /* lock type: read/write, etc. */ + short l_whence; /* type of l_start */ + }; + The commands available for advisory record locking are as follows: + + F_GETLK Get the first lock that blocks the lock description pointed to + by the third argument, _a_r_g, taken as a pointer to a _s_t_r_u_c_t + _f_l_o_c_k (see above). The information retrieved overwrites the + information passed to ffccnnttll in the _f_l_o_c_k structure. If no + lock is found that would prevent this lock from being created, + the structure is left unchanged by this function call except + for the lock type which is set to F_UNLCK. + + F_SETLK Set or clear a file segment lock according to the lock de- + scription pointed to by the third argument, _a_r_g, taken as a + pointer to a _s_t_r_u_c_t _f_l_o_c_k (see above). F_SETLK is used to es- + tablish shared (or read) locks (F_RDLCK) or exclusive (or + write) locks, (F_WRLCK), as well as remove either type of lock + (F_UNLCK). If a shared or exclusive lock cannot be set, ffccnnttll + returns immediately with EACCES. + + F_SETLKW This command is the same as F_SETLK except that if a shared or + exclusive lock is blocked by other locks, the process waits + until the request can be satisfied. If a signal that is to be + caught is received while ffccnnttll is waiting for a region, the + ffccnnttll will be interrupted if the signal handler has not speci- + fied the SA_RESTART (see sigaction(2)). + + When a shared lock has been set on a segment of a file, other processes + can set shared locks on that segment or a portion of it. A shared lock + prevents any other process from setting an exclusive lock on any portion + of the protected area. A request for a shared lock fails if the file de- + scriptor was not opened with read access. + + An exclusive lock prevents any other process from setting a shared lock + or an exclusive lock on any portion of the protected area. A request for + an exclusive lock fails if the file was not opened with write access. + + The value of _l___w_h_e_n_c_e is SEEK_SET, SEEK_CUR, or SEEK_END to indicate that + the relative offset, _l___s_t_a_r_t bytes, will be measured from the start of + the file, current position, or end of the file, respectively. The value + of _l___l_e_n is the number of consecutive bytes to be locked. If _l___l_e_n is + negative, the result is undefined. The _l___p_i_d field is only used with + F_GETLK to return the process ID of the process holding a blocking lock. + After a successful F_GETLK request, the value of _l___w_h_e_n_c_e is SEEK_SET. + + Locks may start and extend beyond the current end of a file, but may not + start or extend before the beginning of the file. A lock is set to ex- + tend to the largest possible value of the file offset for that file if + _l___l_e_n is set to zero. If _l___w_h_e_n_c_e and _l___s_t_a_r_t point to the beginning of + the file, and _l___l_e_n is zero, the entire file is locked. If an applica- + tion wishes only to do entire file locking, the flock(2) system call is + much more efficient. + + There is at most one type of lock set for each byte in the file. Before + a successful return from an F_SETLK or an F_SETLKW request when the call- + ing process has previously existing locks on bytes in the region speci- + fied by the request, the previous lock type for each byte in the speci- + fied region is replaced by the new lock type. As specified above under + the descriptions of shared locks and exclusive locks, an F_SETLK or an + F_SETLKW request fails or blocks respectively when another process has + existing locks on bytes in the specified region and the type of any of + those locks conflicts with the type specified in the request. + + This interface follows the completely stupid semantics of System V and + IEEE Std1003.1-1988 (``POSIX'') that require that all locks associated + with a file for a given process are removed when _a_n_y file descriptor for + that file is closed by that process. This semantic means that applica- + tions must be aware of any files that a subroutine library may access. + For example if an application for updating the password file locks the + password file database while making the update, and then calls getpw- + name(3) to retrieve a record, the lock will be lost because getpwname(3) + opens, reads, and closes the password database. The database close will + release all locks that the process has associated with the database, even + if the library routine never requested a lock on the database. Another + minor semantic problem with this interface is that locks are not inherit- + ed by a child process created using the fork(2) function. The flock(2) + interface has much more rational last close semantics and allows locks to + be inherited by child processes. Flock(2) is recommended for applica- + tions that want to ensure the integrity of their locks when using library + routines or wish to pass locks to their children. Note that flock(2) and + fcntl(2) locks may be safely used concurrently. + + All locks associated with a file for a given process are removed when the + process terminates. + + A potential for deadlock occurs if a process controlling a locked region + is put to sleep by attempting to lock the locked region of another pro- + cess. This implementation detects that sleeping until a locked region is + unlocked would cause a deadlock and fails with an EDEADLK error. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, the value returned depends on _c_m_d as follows: + + F_DUPFD A new file descriptor. + + F_GETFD Value of flag (only the low-order bit is defined). + + F_GETFL Value of flags. + + F_GETOWN Value of file descriptor owner. + + other Value other than -1. + + Otherwise, a value of -1 is returned and _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + FFccnnttll() will fail if: + + [EACCES] The argument _a_r_g is F_SETLK, the type of lock _(_l___t_y_p_e_) is a + shared lock (F_RDLCK) or exclusive lock (F_WRLCK), and the + segment of a file to be locked is already exclusive-locked + by another process; or the type is an exclusive lock and + some portion of the segment of a file to be locked is al- + ready shared-locked or exclusive-locked by another process. + + [EBADF] _F_i_l_d_e_s is not a valid open file descriptor. + + The argument _c_m_d is F_SETLK or F_SETLKW, the type of lock + _(_l___t_y_p_e_) is a shared lock (F_RDLCK), and _f_i_l_d_e_s is not a + valid file descriptor open for reading. + + The argument _c_m_d is F_SETLK or F_SETLKW, the type of lock + _(_l___t_y_p_e_) is an exclusive lock (F_WRLCK), and _f_i_l_d_e_s is not + a valid file descriptor open for writing. + + [EMFILE] _C_m_d is F_DUPFD and the maximum allowed number of file de- + + scriptors are currently open. + + [EDEADLK] The argument _c_m_d is F_SETLKW, and a deadlock condition was + detected. + + [EINTR] The argument _c_m_d is F_SETLKW, and the function was inter- + rupted by a signal. + + [EINVAL] _C_m_d is F_DUPFD and _a_r_g is negative or greater than the max- + imum allowable number (see getdtablesize(2)). + + The argument _c_m_d is F_GETLK, F_SETLK, or F_SETLKW and the + data to which _a_r_g points is not valid, or _f_i_l_d_e_s refers to + a file that does not support locking. + + [EMFILE] The argument _c_m_d is F_DUPED and the maximum number of file + descriptors permitted for the process are already in use, + or no file descriptors greater than or equal to _a_r_g are + available. + + [ENOLCK] The argument _c_m_d is F_SETLK or F_SETLKW, and satisfying the + lock or unlock request would result in the number of locked + regions in the system exceeding a system-imposed limit. + + [ESRCH] _C_m_d is F_SETOWN and the process ID given as argument is not + in use. + +SSEEEE AALLSSOO + close(2), execve(2), flock(2), getdtablesize(2), open(2), sigvec(2) + +HHIISSTTOORRYY + The ffccnnttll function call appeared in 4.2BSD. + +4.2 Berkeley Distribution July 11, 1993 4 diff --git a/usr/share/man/cat2/flock.0 b/usr/share/man/cat2/flock.0 new file mode 100644 index 0000000000..28cb436d54 --- /dev/null +++ b/usr/share/man/cat2/flock.0 @@ -0,0 +1,70 @@ +FLOCK(2) BSD Programmer's Manual FLOCK(2) + +NNAAMMEE + fflloocckk - apply or remove an advisory lock on an open file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##ddeeffiinnee LLOOCCKK__SSHH 11 //** sshhaarreedd lloocckk **// + ##ddeeffiinnee LLOOCCKK__EEXX 22 //** eexxcclluussiivvee lloocckk **// + ##ddeeffiinnee LLOOCCKK__NNBB 44 //** ddoonn''tt bblloocckk wwhheenn lloocckkiinngg **// + ##ddeeffiinnee LLOOCCKK__UUNN 88 //** uunnlloocckk **// + + _i_n_t + fflloocckk(_i_n_t _f_d, _i_n_t _o_p_e_r_a_t_i_o_n); + +DDEESSCCRRIIPPTTIIOONN + FFlloocckk() applies or removes an _a_d_v_i_s_o_r_y lock on the file associated with + the file descriptor _f_d. A lock is applied by specifying an _o_p_e_r_a_t_i_o_n pa- + rameter that is the inclusive or of LOCK_SH or LOCK_EX and, possibly, + LOCK_NB. To unlock an existing lock operation should be LOCK_UN. + + Advisory locks allow cooperating processes to perform consistent opera- + tions on files, but do not guarantee consistency (i.e., processes may + still access files without using advisory locks possibly resulting in in- + consistencies). + + The locking mechanism allows two types of locks: _s_h_a_r_e_d locks and + _e_x_c_l_u_s_i_v_e locks. At any time multiple shared locks may be applied to a + file, but at no time are multiple exclusive, or both shared and exclu- + sive, locks allowed simultaneously on a file. + + A shared lock may be _u_p_g_r_a_d_e_d to an exclusive lock, and vice versa, sim- + ply by specifying the appropriate lock type; this results in the previous + lock being released and the new lock applied (possibly after other pro- + cesses have gained and released the lock). + + Requesting a lock on an object that is already locked normally causes the + caller to be blocked until the lock may be acquired. If LOCK_NB is in- + cluded in _o_p_e_r_a_t_i_o_n, then this will not happen; instead the call will + fail and the error EWOULDBLOCK will be returned. + +NNOOTTEESS + Locks are on files, not file descriptors. That is, file descriptors du- + plicated through dup(2) or fork(2) do not result in multiple instances of + a lock, but rather multiple references to a single lock. If a process + holding a lock on a file forks and the child explicitly unlocks the file, + the parent will lose its lock. + + Processes blocked awaiting a lock may be awakened by signals. + +RREETTUURRNN VVAALLUUEESS + Zero is returned if the operation was successful; on an error a -1 is re- + turned and an error code is left in the global location _e_r_r_n_o. + +EERRRROORRSS + The fflloocckk() call fails if: + + [EWOULDBLOCK] The file is locked and the LOCK_NB option was specified. + + [EBADF] The argument _f_d is an invalid descriptor. + + [EINVAL] The argument _f_d refers to an object other than a file. + +SSEEEE AALLSSOO + open(2), close(2), dup(2), execve(2), fork(2) + +HHIISSTTOORRYY + The fflloocckk function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/fork.0 b/usr/share/man/cat2/fork.0 new file mode 100644 index 0000000000..62a2d3bc19 --- /dev/null +++ b/usr/share/man/cat2/fork.0 @@ -0,0 +1,60 @@ +FORK(2) BSD Programmer's Manual FORK(2) + +NNAAMMEE + ffoorrkk - create a new process + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _p_i_d___t + ffoorrkk(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + FFoorrkk() causes creation of a new process. The new process (child process) + is an exact copy of the calling process (parent process) except for the + following: + + ++oo The child process has a unique process ID. + + ++oo The child process has a different parent process ID (i.e., the + process ID of the parent process). + + ++oo The child process has its own copy of the parent's descriptors. + These descriptors reference the same underlying objects, so + that, for instance, file pointers in file objects are shared + between the child and the parent, so that an lseek(2) on a de- + scriptor in the child process can affect a subsequent read or + write by the parent. This descriptor copying is also used by + the shell to establish standard input and output for newly cre- + ated processes as well as to set up pipes. + + ++oo The child processes resource utilizations are set to 0; see + setrlimit(2). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffoorrkk() returns a value of 0 to the child pro- + cess and returns the process ID of the child process to the parent pro- + cess. Otherwise, a value of -1 is returned to the parent process, no + child process is created, and the global variable _e_r_r_n_o is set to indi- + cate the error. + +EERRRROORRSS + FFoorrkk() will fail and no child process will be created if: + + [EAGAIN] The system-imposed limit on the total number of processes under + execution would be exceeded. This limit is configuration- + dependent. + + [EAGAIN] The system-imposed limit MAXUPRC (<_s_y_s_/_p_a_r_a_m_._h>) on the total + number of processes under execution by a single user would be + exceeded. + + [ENOMEM] There is insufficient swap space for the new process. + +SSEEEE AALLSSOO + execve(2), wait(2) + +HHIISSTTOORRYY + A ffoorrkk(_2) function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/fpathconf.0 b/usr/share/man/cat2/fpathconf.0 new file mode 100644 index 0000000000..a6b5e3bda2 --- /dev/null +++ b/usr/share/man/cat2/fpathconf.0 @@ -0,0 +1,104 @@ +PATHCONF(2) BSD Programmer's Manual PATHCONF(2) + +NNAAMMEE + ppaatthhccoonnff, ffppaatthhccoonnff - get configurable pathname variables + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + ppaatthhccoonnff(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _n_a_m_e); + + _l_o_n_g + ffppaatthhccoonnff(_i_n_t _f_d, _i_n_t _n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + The ppaatthhccoonnff() and ffppaatthhccoonnff() functions provides a method for applica- + tions to determine the current value of a configurable system limit or + option variable associated with a pathname or file descriptor. + + For ppaatthhccoonnff, the _p_a_t_h argument is the name of a file or directory. For + ffppaatthhccoonnff, the _f_d argument is an open file descriptor. The _n_a_m_e argument + specifies the system variable to be queried. Symbolic constants for each + name value are found in the include file . + + The available values are as follows: + + _PC_LINK_MAX + The maximum file link count. + + _PC_MAX_CANON + The maximum number of bytes in terminal canonical input line. + + _PC_MAX_INPUT + The minimum maximum number of bytes for which space is available + in a terminal input queue. + + _PC_NAME_MAX + The maximum number of bytes in a file name. + + _PC_PATH_MAX + The maximum number of bytes in a pathname. + + _PC_PIPE_BUF + The maximum number of bytes which will be written atomically to a + pipe. + + _PC_CHOWN_RESTRICTED + Return 1 if appropriate privileges are required for the chown(2) + system call, otherwise 0. + + _PC_NO_TRUNC + Return 1 if file names longer than KERN_NAME_MAX are truncated. + + _PC_VDISABLE + Returns the terminal character disabling value. + +RREETTUURRNN VVAALLUUEESS + If the call to ppaatthhccoonnff or ffppaatthhccoonnff is not successful, -1 is returned + and _e_r_r_n_o is set appropriately. Otherwise, if the variable is associated + with functionality that does not have a limit in the system, -1 is re- + turned and _e_r_r_n_o is not modified. Otherwise, the current variable value + is returned. + +EERRRROORRSS + If any of the following conditions occur, the ppaatthhccoonnff and ffppaatthhccoonnff + + functions shall return -1 and set _e_r_r_n_o to the corresponding value. + + [EINVAL] The value of the _n_a_m_e argument is invalid. + + [EINVAL] The implementation does not support an association of the + variable name with the associated file. + PPaatthhccoonnff() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + + FFppaatthhccoonnff() will fail if: + + [EBADF] _f_d is not a valid open file descriptor. + + [EIO] An I/O error occurred while reading from or writing to the file + system. + +SSEEEE AALLSSOO + sysctl(3) + +HHIISSTTOORRYY + The ppaatthhccoonnff and ffppaatthhccoonnff functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/fstat.0 b/usr/share/man/cat2/fstat.0 new file mode 100644 index 0000000000..80cf30d689 --- /dev/null +++ b/usr/share/man/cat2/fstat.0 @@ -0,0 +1,157 @@ +STAT(2) BSD Programmer's Manual STAT(2) + +NNAAMMEE + ssttaatt, llssttaatt, ffssttaatt - get file status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + llssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + ffssttaatt(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + The ssttaatt() function obtains information about the file pointed to by + _p_a_t_h. Read, write or execute permission of the named file is not re- + quired, but all directories listed in the path name leading to the file + must be seachable. + + LLssttaatt() is like ssttaatt() except in the case where the named file is a sym- + bolic link, in which case llssttaatt() returns information about the link, + while ssttaatt() returns information about the file the link references. Un- + like other filesystem objects, symbolic links do not have an owner, + group, access mode, times, etc. Instead, these attributes are taken from + the directory that contains the link. The only attributes returned from + an llssttaatt() that refer to the symbolic link itself are the file type + (S_IFLNK), size, blocks, and link count (always 1). + + The ffssttaatt() obtains the same information about an open file known by the + file descriptor _f_d, such as would be obtained by an open call. + + _B_u_f is a pointer to a ssttaatt() structure as defined by <_s_y_s_/_s_t_a_t_._h> (shown + below) and into which information is placed concerning the file. + + struct stat { + dev_t st_dev; /* device inode resides on */ + ino_t st_ino; /* inode's number */ + mode_t st_mode; /* inode protection mode */ + nlink_t st_nlink; /* number or hard links to the file */ + uid_t st_uid; /* user-id of owner */ + gid_t st_gid; /* group-id of owner */ + dev_t st_rdev; /* device type, for special file inode */ + off_t st_size; /* file size, in bytes */ + time_t st_atime; /* time of last access */ + long st_spare1; + time_t st_mtime; /* time of last data modification */ + long st_spare2; + time_t st_ctime; /* time of last file status change */ + long st_spare3; + long st_blksize;/* optimal file sys I/O ops blocksize */ + long st_blocks; /* blocks allocated for file */ + u_long st_flags; /* user defined flags for file */ + u_long st_gen; /* file generation number */ + }; + + The time-related fields of _s_t_r_u_c_t _s_t_a_t are as follows: + + st_atime Time when file data last accessed. Changed by the following + + + system calls: mknod(2), utimes(2), and read(2). + + st_mtime Time when file data last modified. Changed by the following + system calls: mknod(2), utimes(2), write(2). + + st_ctime Time when file status was last changed (inode data modifica- + tion). Changed by the following system calls: chmod(2) + chown(2), link(2), mknod(2), rename(2), unlink(2), + utimes(2), write(2). + + st_blocks The actual number of blocks allocated for the file in 512-byte + units. + + The status information word _s_t___m_o_d_e has bits: + + #define S_IFMT 0170000 /* type of file */ + #define S_IFIFO 0010000 /* named pipe (fifo) */ + #define S_IFCHR 0020000 /* character special */ + #define S_IFDIR 0040000 /* directory */ + #define S_IFBLK 0060000 /* block special */ + #define S_IFREG 0100000 /* regular */ + #define S_IFLNK 0120000 /* symbolic link */ + #define S_IFSOCK 0140000 /* socket */ + #define S_ISUID 0004000 /* set user id on execution */ + #define S_ISGID 0002000 /* set group id on execution */ + #define S_ISVTX 0001000 /* save swapped text even after use */ + #define S_IRUSR 0000400 /* read permission, owner */ + #define S_IWUSR 0000200 /* write permission, owner */ + #define S_IXUSR 0000100 /* execute/search permission, owner */ + + For a list of access modes, see <_s_y_s_/_s_t_a_t_._h>, access(2) and chmod(2). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSttaatt() and llssttaatt() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EFAULT] _B_u_f or _n_a_m_e points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + + FFssttaatt() will fail if: + + [EBADF] _f_d is not a valid open file descriptor. + + + + [EFAULT] _B_u_f points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the file + system. + +CCAAVVEEAATT + The fields in the stat structure currently marked _s_t___s_p_a_r_e_1, _s_t___s_p_a_r_e_2, + and _s_t___s_p_a_r_e_3 are present in preparation for inode time stamps expanding + to 64 bits. This, however, can break certain programs that depend on the + time stamps being contiguous (in calls to utimes(2)). + +SSEEEE AALLSSOO + chmod(2), chown(2), utimes(2) symlink(7) + +BBUUGGSS + Applying fstat to a socket (and thus to a pipe) returns a zero'd buffer, + except for the blocksize field, and a unique device and inode number. + +SSTTAANNDDAARRDDSS + The ssttaatt() and ffssttaatt() function calls are expected to conform to IEEE Std + 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + A llssttaatt function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/fstatfs.0 b/usr/share/man/cat2/fstatfs.0 new file mode 100644 index 0000000000..3d84102942 --- /dev/null +++ b/usr/share/man/cat2/fstatfs.0 @@ -0,0 +1,93 @@ +STATFS(2) BSD Programmer's Manual STATFS(2) + +NNAAMMEE + ssttaattffss - get file system statistics + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssttaattffss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f); + + _i_n_t + ffssttaattffss(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + SSttaattffss() returns information about a mounted file system. _P_a_t_h is the + path name of any file within the mounted filesystem. _B_u_f is a pointer to + a ssttaattffss() structure defined as follows: + + typedef quad fsid_t; + + #define MNAMELEN 32 /* length of buffer for returned name */ + + struct statfs { + short f_type; /* type of filesystem (see below) */ + short f_flags; /* copy of mount flags */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* 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 non-superuser */ + 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_spare[6]; /* spare for later */ + char f_mntonname[MNAMELEN]; /* mount point */ + char f_mntfromname[MNAMELEN]; /* mounted filesystem */ + }; + /* + * File system types. + */ + #define MOUNT_UFS 1 + #define MOUNT_NFS 2 + #define MOUNT_MFS 3 + #define MOUNT_PC 4 + + Fields that are undefined for a particular file system are set to -1. + FFssttaattffss() returns the same information about an open file referenced by + descriptor _f_d. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSttaattffss() fails if one or more of the following are true: + + [ENOTDIR] A component of the path prefix of _P_a_t_h is not a directory. + + [EINVAL] _p_a_t_h contains a character with the high-order bit set. + + [ENAMETOOLONG] + The length of a component of _p_a_t_h exceeds 255 characters, + + or the length of _p_a_t_h exceeds 1023 characters. + + [ENOENT] The file referred to by _p_a_t_h does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix of _p_a_t_h. + + [ELOOP] Too many symbolic links were encountered in translating + _p_a_t_h. + + [EFAULT] _B_u_f or _p_a_t_h points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFssttaattffss() fails if one or both of the following are true: + + [EBADF] _F_d is not a valid open file descriptor. + + [EFAULT] _B_u_f points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +HHIISSTTOORRYY + The ssttaattffss function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/fsync.0 b/usr/share/man/cat2/fsync.0 new file mode 100644 index 0000000000..b5711bd3c3 --- /dev/null +++ b/usr/share/man/cat2/fsync.0 @@ -0,0 +1,39 @@ +FSYNC(2) BSD Programmer's Manual FSYNC(2) + +NNAAMMEE + ffssyynncc - synchronize a file's in-core state with that on disk + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffssyynncc(_i_n_t _f_d); + +DDEESSCCRRIIPPTTIIOONN + FFssyynncc() causes all modified data and attributes of _f_d to be moved to a + permanent storage device. This normally results in all in-core modified + copies of buffers for the associated file to be written to a disk. + + FFssyynncc() should be used by programs that require a file to be in a known + state, for example, in building a simple transaction facility. + +RREETTUURRNN VVAALLUUEESS + A 0 value is returned on success. A -1 value indicates an error. + +EERRRROORRSS + The ffssyynncc() fails if: + + [EBADF] _F_d is not a valid descriptor. + + [EINVAL] _F_d refers to a socket, not to a file. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +SSEEEE AALLSSOO + sync(2), sync(8), update(8) + +HHIISSTTOORRYY + The ffssyynncc function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/ftruncate.0 b/usr/share/man/cat2/ftruncate.0 new file mode 100644 index 0000000000..9d0c8ffd2a --- /dev/null +++ b/usr/share/man/cat2/ftruncate.0 @@ -0,0 +1,75 @@ +TRUNCATE(2) BSD Programmer's Manual TRUNCATE(2) + +NNAAMMEE + ttrruunnccaattee, ffttrruunnccaattee - truncate a file to a specified length + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttrruunnccaattee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _o_f_f___t _l_e_n_g_t_h); + + _i_n_t + ffttrruunnccaattee(_i_n_t _f_d, _o_f_f___t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + TTrruunnccaattee() causes the file named by _p_a_t_h or referenced by _f_d to be trun- + cated to at most _l_e_n_g_t_h bytes in size. If the file previously was larger + than this size, the extra data is lost. With ffttrruunnccaattee(), the file must + be open for writing. + +RREETTUURRNN VVAALLUUEESS + A value of 0 is returned if the call succeeds. If the call fails a -1 is + returned, and the global variable _e_r_r_n_o specifies the error. + +EERRRROORRSS + TTrruunnccaattee() succeeds unless: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path pre- + fix. + + [EACCES] The named file is not writable by the user. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EISDIR] The named file is a directory. + + [EROFS] The named file resides on a read-only file system. + + [ETXTBSY] The file is a pure procedure (shared text) file that is being + executed. + + [EIO] An I/O error occurred updating the inode. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + FFttrruunnccaattee() succeeds unless: + + [EBADF] The _f_d is not a valid descriptor. + + [EINVAL] The _f_d references a socket, not a file. + + [EINVAL] The _f_d is not open for writing. + +SSEEEE AALLSSOO + open(2) + +BBUUGGSS + These calls should be generalized to allow ranges of bytes in a file to + be discarded. + +HHIISSTTOORRYY + The ttrruunnccaattee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/getdirentries.0 b/usr/share/man/cat2/getdirentries.0 new file mode 100644 index 0000000000..d60e67d576 --- /dev/null +++ b/usr/share/man/cat2/getdirentries.0 @@ -0,0 +1,73 @@ +GETDIRENTRIES(2) BSD Programmer's Manual GETDIRENTRIES(2) + +NNAAMMEE + ggeettddiirreennttrriieess - get directory entries in a filesystem independent format + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettddiirreennttrriieess(_i_n_t _f_d, _c_h_a_r _*_b_u_f, _i_n_t _n_b_y_t_e_s, _l_o_n_g _*_b_a_s_e_p); + +DDEESSCCRRIIPPTTIIOONN + GGeettddiirreennttrriieess() reads directory entries from the directory referenced by + the file descriptor _f_d into the buffer pointed to by _b_u_f, in a filesystem + independent format. Up to _n_b_y_t_e_s of data will be transferred. _N_b_y_t_e_s + must be greater than or equal to the block size associated with the file, + see stat(2). Some filesystems may not support ggeettddiirreennttrriieess() with + buffers smaller than this size. + + The data in the buffer is a series of _d_i_r_e_n_t structures each containing + the following entries: + + unsigned long d_fileno; + unsigned short d_reclen; + unsigned short d_namlen; + char d_name[MAXNAMELEN + 1]; /* see below */ + + The _d___f_i_l_e_n_o entry is a number which is unique for each distinct file in + the filesystem. Files that are linked by hard links (see link(2)) have + the same _d___f_i_l_e_n_o. The _d___r_e_c_l_e_n entry is the length, in bytes, of the di- + rectory record. The _d___n_a_m_e entry contains a null terminated file name. + The _d___n_a_m_l_e_n entry specifies the length of the file name excluding the + null byte. Thus the actual size of _d___n_a_m_e may vary from 1 to MAXNAMELEN + + 1. + + Entries may be separated by extra space. The _d___r_e_c_l_e_n entry may be used + as an offset from the start of a _d_i_r_e_n_t structure to the next structure, + if any. + + The actual number of bytes transferred is returned. The current position + pointer associated with _f_d is set to point to the next block of entries. + The pointer may not advance by the number of bytes returned by + ggeettddiirreennttrriieess(). A value of zero is returned when the end of the direc- + tory has been reached. + + GGeettddiirreennttrriieess() writes the position of the block read into the location + pointed to by _b_a_s_e_p. Alternatively, the current position pointer may be + set and retrieved by lseek(2). The current position pointer should only + be set to a value returned by lseek(2), a value returned in the location + pointed to by _b_a_s_e_p, or zero. + +RREETTUURRNN VVAALLUUEESS + If successful, the number of bytes actually transferred is returned. + Otherwise, -1 is returned and the global variable _e_r_r_n_o is set to indi- + cate the error. + +EERRRROORRSS + GGeettddiirreennttrriieess() will fail if: + + EBADF _f_d is not a valid file descriptor open for reading. + + EFAULT Either _b_u_f or _b_a_s_e_p point outside the allocated address space. + + EIO An I/O error occurred while reading from or writing to the file + system. + +SSEEEE AALLSSOO + open(2), lseek(2) + +HHIISSTTOORRYY + The ggeettddiirreennttrriieess function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/getdtablesize.0 b/usr/share/man/cat2/getdtablesize.0 new file mode 100644 index 0000000000..046ee63289 --- /dev/null +++ b/usr/share/man/cat2/getdtablesize.0 @@ -0,0 +1,24 @@ +GETDTABLESIZE(2) BSD Programmer's Manual GETDTABLESIZE(2) + +NNAAMMEE + ggeettddttaabblleessiizzee - get descriptor table size + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettddttaabblleessiizzee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + Each process has a fixed size descriptor table, which is guaranteed to + have at least 20 slots. The entries in the descriptor table are numbered + with small integers starting at 0. The call ggeettddttaabblleessiizzee() returns the + size of this table. + +SSEEEE AALLSSOO + close(2), dup(2), open(2), select(2) + +HHIISSTTOORRYY + The ggeettddttaabblleessiizzee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getegid.0 b/usr/share/man/cat2/getegid.0 new file mode 100644 index 0000000000..683eb49a94 --- /dev/null +++ b/usr/share/man/cat2/getegid.0 @@ -0,0 +1,36 @@ +GETGID(2) BSD Programmer's Manual GETGID(2) + +NNAAMMEE + ggeettggiidd, ggeetteeggiidd - get group process identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _g_i_d___t + ggeettggiidd(_v_o_i_d); + + _g_i_d___t + ggeetteeggiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettggiidd() function returns the real group ID of the calling process, + ggeetteeggiidd() returns the effective group ID of the calling process. + + The real group ID is specified at login time. + + The real group ID is the group of the user who invoked the program. As + the effective group ID gives the process additional permissions during + the execution of ``_s_e_t_-_g_r_o_u_p_-_I_D'' mode processes, ggeettggiidd() is used to de- + termine the real-user-id of the calling process. + +EERRRROORRSS + The ggeettggiidd() and ggeetteeggiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + getuid(2), setregid(2), setgid(3) + +SSTTAANNDDAARRDDSS + GGeettggiidd() and ggeetteeggiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/geteuid.0 b/usr/share/man/cat2/geteuid.0 new file mode 100644 index 0000000000..2049e9252c --- /dev/null +++ b/usr/share/man/cat2/geteuid.0 @@ -0,0 +1,36 @@ +GETUID(2) BSD Programmer's Manual GETUID(2) + +NNAAMMEE + ggeettuuiidd, ggeetteeuuiidd - get user identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u_i_d___t + ggeettuuiidd(_v_o_i_d); + + _u_i_d___t + ggeetteeuuiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettuuiidd() function returns the real user ID of the calling process. + The ggeetteeuuiidd() function returns the effective user ID of the calling pro- + cess. + + The real user ID is that of the user who has invoked the program. As the + effective user ID gives the process additional permissions during execu- + tion of ``_s_e_t_-_u_s_e_r_-_I_D'' mode processes, ggeettuuiidd() is used to determine the + real-user-id of the calling process. + +EERRRROORRSS + The ggeettuuiidd() and ggeetteeuuiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + getgid(2), setreuid(2) + +SSTTAANNDDAARRDDSS + GGeetteeuuiidd() and ggeettuuiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getfh.0 b/usr/share/man/cat2/getfh.0 new file mode 100644 index 0000000000..8ca3564a2e --- /dev/null +++ b/usr/share/man/cat2/getfh.0 @@ -0,0 +1,49 @@ +GETFH(2) BSD Programmer's Manual GETFH(2) + +NNAAMMEE + ggeettffhh - get file handle + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettffhh(_c_h_a_r _*_p_a_t_h, _f_h_a_n_d_l_e___t _*_f_h_p); + +DDEESSCCRRIIPPTTIIOONN + GGeettffhh() returns a file handle for the specified file or directory in the + file handle pointed to by _f_h_p. This system call is restricted to the su- + peruser. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + GGeettffhh() fails if one or more of the following are true: + + [ENOTDIR] A component of the path prefix of _p_a_t_h is not a directory. + + [EINVAL] _p_a_t_h contains a character with the high-order bit set. + + [ENAMETOOLONG] + The length of a component of _p_a_t_h exceeds 255 characters, + or the length of _p_a_t_h exceeds 1023 characters. + + [ENOENT] The file referred to by _p_a_t_h does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix of _p_a_t_h. + + [ELOOP] Too many symbolic links were encountered in translating + _p_a_t_h. + + [EFAULT] _F_h_p points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +HHIISSTTOORRYY + The ggeettffhh function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/getfsstat.0 b/usr/share/man/cat2/getfsstat.0 new file mode 100644 index 0000000000..222a0340fc --- /dev/null +++ b/usr/share/man/cat2/getfsstat.0 @@ -0,0 +1,77 @@ +GETFSSTAT(2) BSD Programmer's Manual GETFSSTAT(2) + +NNAAMMEE + ggeettffssssttaatt - get list of all mounted filesystems + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettffssssttaatt(_s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f, _l_o_n_g _b_u_f_s_i_z_e, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + GGeettffssssttaatt() returns information about all mounted filesystems. _B_u_f is a + pointer to statfs structures defined as follows: + + typedef quad fsid_t; + + #define MNAMELEN 32 /* length of buffer for returned name */ + + struct statfs { + short f_type; /* type of filesystem (see below) */ + short f_flags; /* copy of mount flags */ + long f_bsize; /* fundamental filesystem block size */ + long f_iosize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in filesystem */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in filesystem */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* filesystem id */ + long f_spare[6]; /* spare for later */ + char f_mntonname[MNAMELEN]; /* directory on which mounted */ + char f_mntfromname[MNAMELEN]; /* mounted filesystem */ + }; + /* + * File system types. + */ + #define MOUNT_UFS 1 + #define MOUNT_NFS 2 + #define MOUNT_PC 3 + + Fields that are undefined for a particular filesystem are set to -1. The + buffer is filled with an array of _f_s_s_t_a_t structures, one for each mounted + filesystem up to the size specified by _b_u_f_s_i_z_e. + + If _b_u_f is given as NULL, ggeettffssssttaatt() returns just the number of mounted + filesystems. + + Normally _f_l_a_g_s should be specified as MNT_WAIT. If _f_l_a_g_s is set to + MNT_NOWAIT, ggeettffssssttaatt() will return the information it has available + without requesting an update from each filesystem. Thus, some of the in- + formation will be out of date, but ggeettffssssttaatt() will not block waiting for + information from a filesystem that is unable to respond. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, the number of _f_s_s_t_a_t structures is returned. + Otherwise, -1 is returned and the global variable _e_r_r_n_o is set to indi- + cate the error. + +EERRRROORRSS + GGeettffssssttaatt() fails if one or more of the following are true: + + + EFAULT _B_u_f points to an invalid address. + + EIO An I/O error occurred while reading from or writing to the + filesystem. + +SSEEEE AALLSSOO + statfs(2), fstab(5), mount(8) + +HHIISSTTOORRYY + The ggeettffssssttaatt function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/getgid.0 b/usr/share/man/cat2/getgid.0 new file mode 100644 index 0000000000..683eb49a94 --- /dev/null +++ b/usr/share/man/cat2/getgid.0 @@ -0,0 +1,36 @@ +GETGID(2) BSD Programmer's Manual GETGID(2) + +NNAAMMEE + ggeettggiidd, ggeetteeggiidd - get group process identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _g_i_d___t + ggeettggiidd(_v_o_i_d); + + _g_i_d___t + ggeetteeggiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettggiidd() function returns the real group ID of the calling process, + ggeetteeggiidd() returns the effective group ID of the calling process. + + The real group ID is specified at login time. + + The real group ID is the group of the user who invoked the program. As + the effective group ID gives the process additional permissions during + the execution of ``_s_e_t_-_g_r_o_u_p_-_I_D'' mode processes, ggeettggiidd() is used to de- + termine the real-user-id of the calling process. + +EERRRROORRSS + The ggeettggiidd() and ggeetteeggiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + getuid(2), setregid(2), setgid(3) + +SSTTAANNDDAARRDDSS + GGeettggiidd() and ggeetteeggiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getgroups.0 b/usr/share/man/cat2/getgroups.0 new file mode 100644 index 0000000000..665b76f794 --- /dev/null +++ b/usr/share/man/cat2/getgroups.0 @@ -0,0 +1,43 @@ +GETGROUPS(2) BSD Programmer's Manual GETGROUPS(2) + +NNAAMMEE + ggeettggrroouuppss - get group access list + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettggrroouuppss(_i_n_t _g_i_d_s_e_t_l_e_n, _i_n_t _*_g_i_d_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + GGeettggrroouuppss() gets the current group access list of the user process and + stores it in the array _g_i_d_s_e_t. The parameter _g_i_d_s_e_t_l_e_n indicates the num- + ber of entries that may be placed in _g_i_d_s_e_t. GGeettggrroouuppss() returns the ac- + tual number of groups returned in _g_i_d_s_e_t. No more than NGROUPS, as de- + fined in <_s_y_s_/_p_a_r_a_m_._h>, will ever be returned. + +RREETTUURRNN VVAALLUUEESS + A successful call returns the number of groups in the group set. A value + of -1 indicates that an error occurred, and the error code is stored in + the global variable _e_r_r_n_o. + +EERRRROORRSS + The possible errors for ggeettggrroouuppss() are: + + [EINVAL] The argument _g_i_d_s_e_t_l_e_n is smaller than the number of groups + in the group set. + + [EFAULT] The argument _g_i_d_s_e_t specifies an invalid address. + +SSEEEE AALLSSOO + setgroups(2), initgroups(3) + +BBUUGGSS + The _g_i_d_s_e_t array should be of type _g_i_d___t _, + but remains integer for compatibility with earlier systems. + +HHIISSTTOORRYY + The ggeettggrroouuppss function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/gethostid.0 b/usr/share/man/cat2/gethostid.0 new file mode 100644 index 0000000000..985bd65170 --- /dev/null +++ b/usr/share/man/cat2/gethostid.0 @@ -0,0 +1,36 @@ +GETHOSTID(3) BSD Programmer's Manual GETHOSTID(3) + +NNAAMMEE + ggeetthhoossttiidd, sseetthhoossttiidd - get/set unique identifier of current host + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + ggeetthhoossttiidd(_v_o_i_d); + + _i_n_t + sseetthhoossttiidd(_l_o_n_g _h_o_s_t_i_d); + +DDEESSCCRRIIPPTTIIOONN + SSeetthhoossttiidd() establishes a 32-bit identifier for the current processor + that is intended to be unique among all UNIX systems in existence. This + is normally a DARPA Internet address for the local machine. This call is + allowed only to the super-user and is normally performed at boot time. + + GGeetthhoossttiidd() returns the 32-bit identifier for the current processor. + + This function has been deprecated. The hostid should be set or retrieved + by use of sysctl(2). + +SSEEEE AALLSSOO + sysctl(2), gethostname(3), sysctl(8). + +BBUUGGSS + 32 bits for the identifier is too small. + +HHIISSTTOORRYY + The ggeetthhoossttiidd() and sseetthhoossttiidd() syscalls appeared in 4.2BSD and were + dropped in 4.4BSD. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/getitimer.0 b/usr/share/man/cat2/getitimer.0 new file mode 100644 index 0000000000..d9a075530b --- /dev/null +++ b/usr/share/man/cat2/getitimer.0 @@ -0,0 +1,81 @@ +GETITIMER(2) BSD Programmer's Manual GETITIMER(2) + +NNAAMMEE + ggeettiittiimmeerr, sseettiittiimmeerr - get/set value of interval timer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##ddeeffiinnee IITTIIMMEERR__RREEAALL 00 + ##ddeeffiinnee IITTIIMMEERR__VVIIRRTTUUAALL 11 + ##ddeeffiinnee IITTIIMMEERR__PPRROOFF 22 + + _i_n_t + ggeettiittiimmeerr(_i_n_t _w_h_i_c_h, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_v_a_l_u_e); + + _i_n_t + sseettiittiimmeerr(_i_n_t _w_h_i_c_h, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_v_a_l_u_e, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_o_v_a_l_u_e); + +DDEESSCCRRIIPPTTIIOONN + The system provides each process with three interval timers, defined in + <_s_y_s_/_t_i_m_e_._h>. The ggeettiittiimmeerr() call returns the current value for the + timer specified in _w_h_i_c_h in the structure at _v_a_l_u_e. The sseettiittiimmeerr() call + sets a timer to the specified _v_a_l_u_e (returning the previous value of the + timer if _o_v_a_l_u_e is non-nil). + + A timer value is defined by the _i_t_i_m_e_r_v_a_l structure: + + struct itimerval { + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ + }; + + If _i_t___v_a_l_u_e is non-zero, it indicates the time to the next timer expira- + tion. If _i_t___i_n_t_e_r_v_a_l is non-zero, it specifies a value to be used in + reloading _i_t___v_a_l_u_e when the timer expires. Setting _i_t___v_a_l_u_e to 0 dis- + ables a timer. Setting _i_t___i_n_t_e_r_v_a_l to 0 causes a timer to be disabled + after its next expiration (assuming _i_t___v_a_l_u_e is non-zero). + + Time values smaller than the resolution of the system clock are rounded + up to this resolution (typically 10 milliseconds). + + The ITIMER_REAL timer decrements in real time. A SIGALRM signal is de- + livered when this timer expires. + + The ITIMER_VIRTUAL timer decrements in process virtual time. It runs on- + ly when the process is executing. A SIGVTALRM signal is delivered when + it expires. + + The ITIMER_PROF timer decrements both in process virtual time and when + the system is running on behalf of the process. It is designed to be + used by interpreters in statistically profiling the execution of inter- + preted programs. Each time the ITIMER_PROF timer expires, the SIGPROF + signal is delivered. Because this signal may interrupt in-progress sys- + tem calls, programs using this timer must be prepared to restart inter- + rupted system calls. + +NNOOTTEESS + Three macros for manipulating time values are defined in <_s_y_s_/_t_i_m_e_._h>. + _T_i_m_e_r_c_l_e_a_r sets a time value to zero, _t_i_m_e_r_i_s_s_e_t tests if a time value is + non-zero, and _t_i_m_e_r_c_m_p compares two time values (beware that >= and <= do + not work with this macro). + +RREETTUURRNN VVAALLUUEESS + If the calls succeed, a value of 0 is returned. If an error occurs, the + value -1 is returned, and a more precise error code is placed in the + global variable _e_r_r_n_o. + +EERRRROORRSS + GGeettiittiimmeerr() and sseettiittiimmeerr() will fail if: + + [EFAULT] The _v_a_l_u_e parameter specified a bad address. + + [EINVAL] A _v_a_l_u_e parameter specified a time was too large to be han- + dled. + +SSEEEE AALLSSOO + select(2), sigvec(2), gettimeofday(2) + +HHIISSTTOORRYY + The ggeettiittiimmeerr function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/getlogin.0 b/usr/share/man/cat2/getlogin.0 new file mode 100644 index 0000000000..d949cd7aca --- /dev/null +++ b/usr/share/man/cat2/getlogin.0 @@ -0,0 +1,66 @@ +GETLOGIN(2) BSD Programmer's Manual GETLOGIN(2) + +NNAAMMEE + ggeettllooggiinn, sseettllooggiinn - get/set login name + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeettllooggiinn(_v_o_i_d); + + _i_n_t + sseettllooggiinn(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + The ggeettllooggiinn() routine returns the login name of the user associated with + the current session, as previously set by sseettllooggiinn(). The name is nor- + mally associated with a login shell at the time a session is created, and + is inherited by all processes descended from the login shell. (This is + true even if some of those processes assume another user ID, for example + when su(1) is used.) + + SSeettllooggiinn() sets the login name of the user associated with the current + session to _n_a_m_e. This call is restricted to the super-user, and is nor- + mally used only when a new session is being created on behalf of the + named user (for example, at login time, or when a remote shell is in- + voked). + +RREETTUURRNN VVAALLUUEESS + If a call to ggeettllooggiinn() succeeds, it returns a pointer to a null- + terminated string in a static buffer. If the name has not been set, it + returns NULL. If a call to sseettllooggiinn() succeeds, a value of 0 is returned. + If sseettllooggiinn() fails, a value of -1 is returned and an error code is + placed in the global location _e_r_r_n_o. + +EERRRROORRSS + The following errors may be returned by these calls: + + [EFAULT] The _n_a_m_e parameter gave an invalid address. + + [EINVAL] The _n_a_m_e parameter pointed to a string that was too long. + Login names are limited to MAXLOGNAME (from <_s_y_s_/_p_a_r_a_m_._h>) + characters, currently 12. + + [EPERM] The caller tried to set the login name and was not the su- + per-user. + +SSEEEE AALLSSOO + setsid(2) + +BBUUGGSS + Login names are limited in length by sseettllooggiinn(). However, lower limits + are placed on login names elsewhere in the system (UT_NAMESIZE in + <_u_t_m_p_._h>). + + In earlier versions of the system, ggeettllooggiinn() failed unless the process + was associated with a login terminal. The current implementation (using + sseettllooggiinn()) allows getlogin to succeed even when the process has no con- + trolling terminal. In earlier versions of the system, the value returned + by ggeettllooggiinn() could not be trusted without checking the user ID. + Portable programs should probably still make this check. + +HHIISSTTOORRYY + The ggeettllooggiinn() function first appeared in 4.4BSD. + +4.2 Berkeley Distribution June 9, 1993 1 diff --git a/usr/share/man/cat2/getpeername.0 b/usr/share/man/cat2/getpeername.0 new file mode 100644 index 0000000000..0f0e9463c5 --- /dev/null +++ b/usr/share/man/cat2/getpeername.0 @@ -0,0 +1,41 @@ +GETPEERNAME(2) BSD Programmer's Manual GETPEERNAME(2) + +NNAAMMEE + ggeettppeeeerrnnaammee - get name of connected peer + +SSYYNNOOPPSSIISS + _i_n_t + ggeettppeeeerrnnaammee(_i_n_t _s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_n_a_m_e, _i_n_t _*_n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeettppeeeerrnnaammee() returns the name of the peer connected to socket _s. The + _n_a_m_e_l_e_n parameter should be initialized to indicate the amount of space + pointed to by _n_a_m_e. On return it contains the actual size of the name re- + turned (in bytes). The name is truncated if the buffer provided is too + small. + +DDIIAAGGNNOOSSTTIICCSS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EBADF] The argument _s is not a valid descriptor. + + [ENOTSOCK] The argument _s is a file, not a socket. + + [ENOTCONN] The socket is not connected. + + [ENOBUFS] Insufficient resources were available in the system to per- + form the operation. + + [EFAULT] The _n_a_m_e parameter points to memory not in a valid part of + the process address space. + +SSEEEE AALLSSOO + accept(2), bind(2), socket(2), getsockname(2) + +HHIISSTTOORRYY + The ggeettppeeeerrnnaammee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getpgrp.0 b/usr/share/man/cat2/getpgrp.0 new file mode 100644 index 0000000000..4bfc6f27f3 --- /dev/null +++ b/usr/share/man/cat2/getpgrp.0 @@ -0,0 +1,47 @@ +GETPGRP(2) BSD Programmer's Manual GETPGRP(2) + +NNAAMMEE + ggeettppggrrpp - get process group + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _p_i_d___t + ggeettppggrrpp(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The process group of the current process is returned by ggeettppggrrpp(). + + Process groups are used for distribution of signals, and by terminals to + arbitrate requests for their input: processes that have the same process + group as the terminal are foreground and may read, while others will + block with a signal if they attempt to read. + + This call is thus used by programs such as csh(1) to create process + groups in implementing job control. The ttccggeettppggrrpp() and ttccsseettppggrrpp() + calls are used to get/set the process group of the control terminal. + +SSEEEE AALLSSOO + setpgid(2), termios(4) + +HHIISSTTOORRYY + The ggeettppggrrpp function call appeared in 4.0BSD. + +SSTTAANNDDAARRDDSS + The ggeettppggrrpp() function conforms to IEEE Std 1003.1-1988 (``POSIX''). + +CCOOMMPPAATTAABBIILLIITTYY + This version of ggeettppggrrpp() differs from past Berkeley versions by not tak- + ing a _p_i_d___t _p_i_d argument. This incompatibility is required by IEEE + Std1003.1-1988 (``POSIX''). + + From the IEEE Std1003.1-1988 (``POSIX'') Rationale: + + 4.3BSD provides a ggeettppggrrpp() function that returns the process group ID + for a specified process. Although this function is used to support job + control, all known job-control shells always specify the calling process + with this function. Thus, the simpler System V ggeettppggrrpp() suffices, and + the added complexity of the 4.3BSD ggeettppggrrpp() has been omitted from + POSIX.1. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getpid.0 b/usr/share/man/cat2/getpid.0 new file mode 100644 index 0000000000..fd44edf461 --- /dev/null +++ b/usr/share/man/cat2/getpid.0 @@ -0,0 +1,31 @@ +GETPID(2) BSD Programmer's Manual GETPID(2) + +NNAAMMEE + ggeettppiidd, ggeettppppiidd - get parent or calling process identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _p_i_d___t + ggeettppiidd(_v_o_i_d); + + _p_i_d___t + ggeettppppiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + GGeettppiidd() returns the process ID of the calling process. The ID is guar- + anteed to be unique and is useful for constructing temporary file names. + + GGeettppppiidd() returns the process ID of the parent of the calling process. + +EERRRROORRSS + The ggeettppiidd() and ggeettppppiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + gethostid(2) + +SSTTAANNDDAARRDDSS + GGeettppiidd() and ggeettppppiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getppid.0 b/usr/share/man/cat2/getppid.0 new file mode 100644 index 0000000000..fd44edf461 --- /dev/null +++ b/usr/share/man/cat2/getppid.0 @@ -0,0 +1,31 @@ +GETPID(2) BSD Programmer's Manual GETPID(2) + +NNAAMMEE + ggeettppiidd, ggeettppppiidd - get parent or calling process identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _p_i_d___t + ggeettppiidd(_v_o_i_d); + + _p_i_d___t + ggeettppppiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + GGeettppiidd() returns the process ID of the calling process. The ID is guar- + anteed to be unique and is useful for constructing temporary file names. + + GGeettppppiidd() returns the process ID of the parent of the calling process. + +EERRRROORRSS + The ggeettppiidd() and ggeettppppiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + gethostid(2) + +SSTTAANNDDAARRDDSS + GGeettppiidd() and ggeettppppiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getpriority.0 b/usr/share/man/cat2/getpriority.0 new file mode 100644 index 0000000000..46200c6b99 --- /dev/null +++ b/usr/share/man/cat2/getpriority.0 @@ -0,0 +1,58 @@ +GETPRIORITY(2) BSD Programmer's Manual GETPRIORITY(2) + +NNAAMMEE + ggeettpprriioorriittyy, sseettpprriioorriittyy - get/set program scheduling priority + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o); + + _i_n_t + sseettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o, _i_n_t _p_r_i_o); + +DDEESSCCRRIIPPTTIIOONN + The scheduling priority of the process, process group, or user, as indi- + cated by _w_h_i_c_h and _w_h_o is obtained with the ggeettpprriioorriittyy() call and set + with the sseettpprriioorriittyy() call. _W_h_i_c_h is one of PRIO_PROCESS, PRIO_PGRP, or + PRIO_USER, and _w_h_o is interpreted relative to _w_h_i_c_h (a process identifier + for PRIO_PROCESS, process group identifier for PRIO_PGRP, and a user ID + for PRIO_USER). A zero value of _w_h_o denotes the current process, process + group, or user. _P_r_i_o is a value in the range -20 to 20. The default + priority is 0; lower priorities cause more favorable scheduling. + + The ggeettpprriioorriittyy() call returns the highest priority (lowest numerical + value) enjoyed by any of the specified processes. The sseettpprriioorriittyy() call + sets the priorities of all of the specified processes to the specified + value. Only the super-user may lower priorities. + +RREETTUURRNN VVAALLUUEESS + Since ggeettpprriioorriittyy() can legitimately return the value -1, it is necessary + to clear the external variable _e_r_r_n_o prior to the call, then check it af- + terward to determine if a -1 is an error or a legitimate value. The + sseettpprriioorriittyy() call returns 0 if there is no error, or -1 if there is. + +EERRRROORRSS + GGeettpprriioorriittyy() and sseettpprriioorriittyy() will fail if: + + [ESRCH] No process was located using the _w_h_i_c_h and _w_h_o values spec- + ified. + + [EINVAL] _W_h_i_c_h was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER. + + In addition to the errors indicated above, sseettpprriioorriittyy() will fail if: + + [EPERM] A process was located, but neither its effective nor real + user ID matched the effective user ID of the caller. + + [EACCES] A non super-user attempted to lower a process priority. + +SSEEEE AALLSSOO + nice(1), fork(2), renice(8) + +HHIISSTTOORRYY + The ggeettpprriioorriittyy function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getrlimit.0 b/usr/share/man/cat2/getrlimit.0 new file mode 100644 index 0000000000..be09c3506f --- /dev/null +++ b/usr/share/man/cat2/getrlimit.0 @@ -0,0 +1,113 @@ +GETRLIMIT(2) BSD Programmer's Manual GETRLIMIT(2) + +NNAAMMEE + ggeettrrlliimmiitt, sseettrrlliimmiitt - control maximum system resource consumption + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettrrlliimmiitt(_i_n_t _r_e_s_o_u_r_c_e, _s_t_r_u_c_t _r_l_i_m_i_t _*_r_l_p); + + _i_n_t + sseettrrlliimmiitt(_i_n_t _r_e_s_o_u_r_c_e, _s_t_r_u_c_t _r_l_i_m_i_t _*_r_l_p); + +DDEESSCCRRIIPPTTIIOONN + Limits on the consumption of system resources by the current process and + each process it creates may be obtained with the ggeettrrlliimmiitt() call, and + set with the sseettrrlliimmiitt() call. + + The _r_e_s_o_u_r_c_e parameter is one of the following: + + RLIMIT_CORE The largest size (in bytes) core file that may be creat- + ed. + + RLIMIT_CPU The maximum amount of cpu time (in seconds) to be used by + each process. + + RLIMIT_DATA The maximum size (in bytes) of the data segment for a + process; this defines how far a program may extend its + break with the sbrk(2) system call. + + RLIMIT_FSIZE The largest size (in bytes) file that may be created. + + RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into + memory using the mlock(2) function. + + RLIMIT_NOFILE The maximum number of open files for this process. + + RLIMIT_NPROC The maximum number of simultaneous processes for this us- + er id. + + RLIMIT_RSS The maximum size (in bytes) to which a process's resident + set size may grow. This imposes a limit on the amount of + physical memory to be given to a process; if memory is + tight, the system will prefer to take memory from pro- + cesses that are exceeding their declared resident set + size. + + RLIMIT_STACK The maximum size (in bytes) of the stack segment for a + process; this defines how far a program's stack segment + may be extended. Stack extension is performed automati- + cally by the system. + + A resource limit is specified as a soft limit and a hard limit. When a + soft limit is exceeded a process may receive a signal (for example, if + the cpu time or file size is exceeded), but it will be allowed to contin- + ue execution until it reaches the hard limit (or modifies its resource + limit). The _r_l_i_m_i_t structure is used to specify the hard and soft limits + on a resource, + + struct rlimit { + quad_t rlim_cur; /* current (soft) limit */ + quad_t rlim_max; /* hard limit */ + }; + + Only the super-user may raise the maximum limits. Other users may only + alter _r_l_i_m___c_u_r within the range from 0 to _r_l_i_m___m_a_x or (irreversibly) low- + er _r_l_i_m___m_a_x. + + An ``infinite'' value for a limit is defined as RLIM_INFINITY. + + Because this information is stored in the per-process information, this + system call must be executed directly by the shell if it is to affect all + future processes created by the shell; lliimmiitt is thus a built-in command + to csh(1). + + The system refuses to extend the data or stack space when the limits + would be exceeded in the normal way: a break call fails if the data space + limit is reached. When the stack limit is reached, the process receives + a segmentation fault (SIGSEGV); if this signal is not caught by a handler + using the signal stack, this signal will kill the process. + + A file I/O operation that would create a file larger that the process' + soft limit will cause the write to fail and a signal SIGXFSZ to be gener- + ated; this normally terminates the process, but may be caught. When the + soft cpu time limit is exceeded, a signal SIGXCPU is sent to the offend- + ing process. + +RREETTUURRNN VVAALLUUEESS + A 0 return value indicates that the call succeeded, changing or returning + the resource limit. A return value of -1 indicates that an error oc- + curred, and an error code is stored in the global location _e_r_r_n_o. + +EERRRROORRSS + GGeettrrlliimmiitt() and sseettrrlliimmiitt() will fail if: + + [EFAULT] The address specified for _r_l_p is invalid. + + [EPERM] The limit specified to sseettrrlliimmiitt() would have raised the + maximum limit value, and the caller is not the super-user. + +SSEEEE AALLSSOO + csh(1), quota(2), sigaltstack(2), sigvec(2), sysctl(3) + +BBUUGGSS + There should be lliimmiitt and uunnlliimmiitt commands in sh(1) as well as in csh. + +HHIISSTTOORRYY + The ggeettrrlliimmiitt function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/getrusage.0 b/usr/share/man/cat2/getrusage.0 new file mode 100644 index 0000000000..fa6279e5df --- /dev/null +++ b/usr/share/man/cat2/getrusage.0 @@ -0,0 +1,116 @@ +GETRUSAGE(2) BSD Programmer's Manual GETRUSAGE(2) + +NNAAMMEE + ggeettrruussaaggee - get information about resource utilization + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##ddeeffiinnee RRUUSSAAGGEE__SSEELLFF 00 + ##ddeeffiinnee RRUUSSAAGGEE__CCHHIILLDDRREENN --11 + + _i_n_t + ggeettrruussaaggee(_i_n_t _w_h_o, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + +DDEESSCCRRIIPPTTIIOONN + GGeettrruussaaggee() returns information describing the resources utilized by the + current process, or all its terminated child processes. The _w_h_o parame- + ter is either RUSAGE_SELF or RUSAGE_CHILDREN. The buffer to which _r_u_s_a_g_e + points will be filled in with the following structure: + + struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* integral max resident set size */ + long ru_ixrss; /* integral shared text 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 */ + }; + + The fields are interpreted as follows: + + _r_u___u_t_i_m_e the total amount of time spent executing in user mode. + + _r_u___s_t_i_m_e the total amount of time spent in the system executing on + behalf of the process(es). + + _r_u___m_a_x_r_s_s the maximum resident set size utilized (in kilobytes). + + _r_u___i_x_r_s_s an integral value indicating the amount of memory used by + the text segment that was also shared among other processes. + This value is expressed in units of kilobytes * ticks-of- + execution. + + _r_u___i_d_r_s_s an integral value of the amount of unshared memory residing + in the data segment of a process (expressed in units of + kilobytes * ticks-of-execution). + + _r_u___i_s_r_s_s an integral value of the amount of unshared memory residing + in the stack segment of a process (expressed in units of + kilobytes * ticks-of-execution). + + _r_u___m_i_n_f_l_t the number of page faults serviced without any I/O activity; + here I/O activity is avoided by reclaiming a page frame from + + + the list of pages awaiting reallocation. + + _r_u___m_a_j_f_l_t the number of page faults serviced that required I/O activi- + ty. + + _r_u___n_s_w_a_p the number of times a process was swapped out of main memo- + ry. + + _r_u___i_n_b_l_o_c_k the number of times the file system had to perform input. + + _r_u___o_u_b_l_o_c_k the number of times the file system had to perform output. + + _r_u___m_s_g_s_n_d the number of IPC messages sent. + + _r_u___m_s_g_r_c_v the number of IPC messages received. + + _r_u___n_s_i_g_n_a_l_s the number of signals delivered. + + _r_u___n_v_c_s_w the number of times a context switch resulted due to a pro- + cess voluntarily giving up the processor before its time + slice was completed (usually to await availability of a re- + source). + + _r_u___n_i_v_c_s_w the number of times a context switch resulted due to a high- + er priority process becoming runnable or because the current + process exceeded its time slice. + +NNOOTTEESS + The numbers _r_u___i_n_b_l_o_c_k and _r_u___o_u_b_l_o_c_k account only for real I/O; data + supplied by the caching mechanism is charged only to the first process to + read or write the data. + +EERRRROORRSS + GGeettrruussaaggee() returns -1 on error. The possible errors are: + + [EINVAL] The _w_h_o parameter is not a valid value. + + [EFAULT] The address specified by the _r_u_s_a_g_e parameter is not in a + valid part of the process address space. + +SSEEEE AALLSSOO + gettimeofday(2), wait(2) + +BBUUGGSS + There is no way to obtain information about a child process that has not + yet terminated. + +HHIISSTTOORRYY + The ggeettrruussaaggee function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/getsockname.0 b/usr/share/man/cat2/getsockname.0 new file mode 100644 index 0000000000..356230f49c --- /dev/null +++ b/usr/share/man/cat2/getsockname.0 @@ -0,0 +1,42 @@ +GETSOCKNAME(2) BSD Programmer's Manual GETSOCKNAME(2) + +NNAAMMEE + ggeettssoocckknnaammee - get socket name + +SSYYNNOOPPSSIISS + _i_n_t + ggeettssoocckknnaammee(_i_n_t _s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_n_a_m_e, _i_n_t _*_n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeettssoocckknnaammee() returns the current _n_a_m_e for the specified socket. The + _n_a_m_e_l_e_n parameter should be initialized to indicate the amount of space + pointed to by _n_a_m_e. On return it contains the actual size of the name re- + turned (in bytes). + +DDIIAAGGNNOOSSTTIICCSS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EBADF] The argument _s is not a valid descriptor. + + [ENOTSOCK] The argument _s is a file, not a socket. + + [ENOBUFS] Insufficient resources were available in the system to per- + form the operation. + + [EFAULT] The _n_a_m_e parameter points to memory not in a valid part of + the process address space. + +SSEEEE AALLSSOO + bind(2), socket(2) + +BBUUGGSS + Names bound to sockets in the UNIX domain are inaccessible; getsockname + returns a zero length name. + +HHIISSTTOORRYY + The ggeettssoocckknnaammee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getsockopt.0 b/usr/share/man/cat2/getsockopt.0 new file mode 100644 index 0000000000..18647f0079 --- /dev/null +++ b/usr/share/man/cat2/getsockopt.0 @@ -0,0 +1,181 @@ +GETSOCKOPT(2) BSD Programmer's Manual GETSOCKOPT(2) + +NNAAMMEE + ggeettssoocckkoopptt, sseettssoocckkoopptt - get and set options on sockets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettssoocckkoopptt(_i_n_t _s, _i_n_t _l_e_v_e_l, _i_n_t _o_p_t_n_a_m_e, _v_o_i_d _*_o_p_t_v_a_l, _i_n_t _*_o_p_t_l_e_n); + + _i_n_t + sseettssoocckkoopptt(_i_n_t _s, _i_n_t _l_e_v_e_l, _i_n_t _o_p_t_n_a_m_e, _c_o_n_s_t _v_o_i_d _*_o_p_t_v_a_l, + _i_n_t _o_p_t_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeettssoocckkoopptt() and sseettssoocckkoopptt() manipulate the _o_p_t_i_o_n_s associated with a + socket. 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 socket level, _l_e_v_e_l is specified as SOL_SOCKET. To manipulate options + at any other level the protocol number of the appropriate protocol con- + trolling the option is supplied. For example, to indicate that an option + is to be interpreted by the TCP protocol, _l_e_v_e_l should be set to the pro- + tocol number of TCP; see getprotoent(3). + + The parameters _o_p_t_v_a_l and _o_p_t_l_e_n are used to access option values for + sseettssoocckkoopptt(). For ggeettssoocckkoopptt() they identify a buffer in which the value + for the requested option(s) are to be returned. For ggeettssoocckkoopptt(), _o_p_t_l_e_n + is a value-result parameter, initially containing the size of the buffer + pointed to by _o_p_t_v_a_l, and modified on return to indicate the actual size + of the value returned. If no option value is to be supplied or returned, + _o_p_t_v_a_l may be NULL. + + _O_p_t_n_a_m_e and any specified options are passed uninterpreted to the appro- + priate protocol module for interpretation. The include file + <_s_y_s_/_s_o_c_k_e_t_._h> 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_n_t parameter for _o_p_t_v_a_l. For + sseettssoocckkoopptt(), the parameter should be non-zero to enable a boolean op- + tion, or zero if the option is to be disabled. SO_LINGER uses a _s_t_r_u_c_t + _l_i_n_g_e_r parameter, defined in <_s_y_s_/_s_o_c_k_e_t_._h>, which specifies the desired + state of the option and the linger interval (see below). SO_SNDTIMEO and + SO_RCVTIMEO use a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter, defined in <_s_y_s_/_t_i_m_e_._h>. + + The following options are recognized at the socket level. Except as not- + ed, each may be examined with ggeettssoocckkoopptt() and set with sseettssoocckkoopptt(). + + SO_DEBUG enables recording of debugging information + SO_REUSEADDR enables local address reuse + SO_REUSEPORT enables duplicate address and port bindings + SO_KEEPALIVE enables keep connections alive + SO_DONTROUTE enables routing bypass for outgoing messages + SO_LINGER linger on close if data present + SO_BROADCAST enables permission to transmit broadcast messages + SO_OOBINLINE enables reception of out-of-band data in band + SO_SNDBUF set buffer size for output + SO_RCVBUF set buffer size for input + + + SO_SNDLOWAT set minimum count for output + SO_RCVLOWAT set minimum count for input + SO_SNDTIMEO set timeout value for output + SO_RCVTIMEO set timeout value for input + SO_TYPE get the type of the socket (get only) + SO_ERROR get and clear error on the socket (get only) + + SO_DEBUG enables debugging in the underlying protocol modules. + SO_REUSEADDR indicates that the rules used in validating addresses sup- + plied in a bind(2) call should allow reuse of local addresses. + SO_REUSEPORT allows completely duplicate bindings by multiple processes + if they all set SO_REUSEPORT before binding the port. This option per- + mits multiple instances of a program to each receive UDP/IP multicast or + broadcast datagrams destined for the bound port. SO_KEEPALIVE enables + the periodic transmission of messages on a connected socket. Should the + connected party fail to respond to these messages, the connection is con- + sidered broken and processes using the socket are notified via a SIGPIPE + signal when attempting to send data. SO_DONTROUTE indicates that outgo- + ing messages should bypass the standard routing facilities. Instead, + messages are directed to the appropriate network interface according to + the network portion of the destination address. + + SO_LINGER controls the action taken when unsent messags are queued on + socket and a close(2) is performed. If the socket promises reliable de- + livery of data and SO_LINGER is set, the system will block the process on + the close attempt until it is able to transmit the data or until it de- + cides it is unable to deliver the information (a timeout period, termed + the linger interval, is specified in the sseettssoocckkoopptt() call when SO_LINGER + is requested). If SO_LINGER is disabled and a close is issued, the sys- + tem will process the close in a manner that allows the process to contin- + ue as quickly as possible. + + The option SO_BROADCAST requests permission to send broadcast datagrams + on the socket. Broadcast was a privileged operation in earlier versions + of the system. With protocols that support out-of-band data, the + SO_OOBINLINE option requests that out-of-band data be placed in the nor- + mal data input queue as received; it will then be accessible with recv or + read calls without the MSG_OOB flag. Some protocols always behave as if + this option is set. SO_SNDBUF and SO_RCVBUF are options to adjust the + normal buffer sizes allocated for output and input buffers, respectively. + The buffer size may be increased for high-volume connections, or may be + decreased to limit the possible backlog of incoming data. The system + places an absolute limit on these values. + + SO_SNDLOWAT is an option to set the minimum count for output operations. + Most output operations process all of the data supplied by the call, de- + livering data to the protocol for transmission and blocking as necessary + for flow control. Nonblocking output operations will process as much da- + ta as permitted subject to flow control without blocking, but will pro- + cess no data if flow control does not allow the smaller of the low water + mark value or the entire request to be processed. A select(2) operation + testing the ability to write to a socket will return true only if the low + water mark amount could be processed. The default value for SO_SNDLOWAT + is set to a convenient size for network efficiency, often 1024. + SO_RCVLOWAT is an option to set the minimum count for input operations. + In general, receive calls will block until any (non-zero) amount of data + is received, then return with smaller of the amount available or the + amount requested. The default value for SO_RCVLOWAT is 1. If + SO_RCVLOWAT is set to a larger value, blocking receive calls normally + wait until they have received the smaller of the low water mark value or + the requested amount. Receive calls may still return less than the low + water mark if an error occurs, a signal is caught, or the type of data + next in the receive queue is different than that returned. + + SO_SNDTIMEO is an option to set a timeout value for output operations. + It accepts a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter with the number of seconds and mi- + croseconds used to limit waits for output operations to complete. If a + send operation has blocked for this much time, it returns with a partial + count or with the error EWOULDBLOCK if no data were sent. In the current + implementation, this timer is restarted each time additional data are de- + livered to the protocol, implying that the limit applies to output por- + tions ranging in size from the low water mark to the high water mark for + output. SO_RCVTIMEO is an option to set a timeout value for input opera- + tions. It accepts a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter with the number of seconds + and microseconds used to limit waits for input operations to complete. + In the current implementation, this timer is restarted each time addi- + tional data are received by the protocol, and thus the limit is in effect + an inactivity timer. If a receive operation has been blocked for this + much time without receiving additional data, it returns with a short + count or with the error EWOULDBLOCK if no data were received. + + Finally, SO_TYPE and SO_ERROR are options used only with ggeettssoocckkoopptt(). + SO_TYPE returns the type of the socket, such as SOCK_STREAM; it is useful + for servers that inherit sockets on startup. SO_ERROR returns any pend- + ing error on the socket and clears the error status. It may be used to + check for asynchronous errors on connected datagram sockets or for other + asynchronous errors. + +RREETTUURRNN VVAALLUUEESS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EBADF] The argument _s is not a valid descriptor. + + [ENOTSOCK] The argument _s is a file, not a socket. + + [ENOPROTOOPT] The option is unknown at the level indicated. + + [EFAULT] The address pointed to by _o_p_t_v_a_l is not in a valid part of + the process address space. For ggeettssoocckkoopptt(), this error + may also be returned if _o_p_t_l_e_n is not in a valid part of + the process address space. + +SSEEEE AALLSSOO + ioctl(2), socket(2), getprotoent(3) protocols(5) + +BBUUGGSS + Several of the socket options should be handled at lower levels of the + system. + +HHIISSTTOORRYY + The ggeettssoocckkoopptt system call appeared in 4.2BSD. + +4.3-Reno Berkeley Distribution June 5, 1993 3 diff --git a/usr/share/man/cat2/gettimeofday.0 b/usr/share/man/cat2/gettimeofday.0 new file mode 100644 index 0000000000..b027fad7b1 --- /dev/null +++ b/usr/share/man/cat2/gettimeofday.0 @@ -0,0 +1,62 @@ +GETTIMEOFDAY(2) BSD Programmer's Manual GETTIMEOFDAY(2) + +NNAAMMEE + ggeettttiimmeeooffddaayy, sseettttiimmeeooffddaayy - get/set date and time + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p); + + _i_n_t + sseettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p); + +DDEESSCCRRIIPPTTIIOONN + NNoottee:: ttiimmeezzoonnee iiss nnoo lloonnggeerr uusseedd;; tthhiiss iinnffoorrmmaattiioonn iiss kkeepptt oouuttssiiddee tthhee + kkeerrnneell.. The system's notion of the current Greenwich time and the cur- + rent time zone is obtained with the ggeettttiimmeeooffddaayy() call, and set with the + sseettttiimmeeooffddaayy() call. The time is expressed in seconds and microseconds + since midnight (0 hour), January 1, 1970. The resolution of the system + clock is hardware dependent, and the time may be updated continuously or + in ``ticks.'' If _t_p or _t_z_p is NULL, the associated time information will + not be returned or set. + + The structures pointed to by _t_p and _t_z_p are defined in <_s_y_s_/_t_i_m_e_._h> as: + + struct timeval { + long tv_sec; /* seconds since Jan. 1, 1970 */ + long tv_usec; /* and microseconds */ + }; + + struct timezone { + int tz_minuteswest; /* of Greenwich */ + int tz_dsttime; /* type of dst correction to apply */ + }; + + The _t_i_m_e_z_o_n_e structure indicates the local time zone (measured in minutes + of time westward from Greenwich), and a flag that, if nonzero, indicates + that Daylight Saving time applies locally during the appropriate part of + the year. + + Only the super-user may set the time of day or time zone. + +RREETTUURRNN + A 0 return value indicates that the call succeeded. A -1 return value + indicates an error occurred, and in this case an error code is stored in- + to the global variable _e_r_r_n_o. + +EERRRROORRSS + The following error codes may be set in _e_r_r_n_o: + + [EFAULT] An argument address referenced invalid memory. + + [EPERM] A user other than the super-user attempted to set the time. + +SSEEEE AALLSSOO + date(1), adjtime(2), ctime(3), timed(8) + +HHIISSTTOORRYY + The ggeettttiimmeeooffddaayy function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/getuid.0 b/usr/share/man/cat2/getuid.0 new file mode 100644 index 0000000000..2049e9252c --- /dev/null +++ b/usr/share/man/cat2/getuid.0 @@ -0,0 +1,36 @@ +GETUID(2) BSD Programmer's Manual GETUID(2) + +NNAAMMEE + ggeettuuiidd, ggeetteeuuiidd - get user identification + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u_i_d___t + ggeettuuiidd(_v_o_i_d); + + _u_i_d___t + ggeetteeuuiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettuuiidd() function returns the real user ID of the calling process. + The ggeetteeuuiidd() function returns the effective user ID of the calling pro- + cess. + + The real user ID is that of the user who has invoked the program. As the + effective user ID gives the process additional permissions during execu- + tion of ``_s_e_t_-_u_s_e_r_-_I_D'' mode processes, ggeettuuiidd() is used to determine the + real-user-id of the calling process. + +EERRRROORRSS + The ggeettuuiidd() and ggeetteeuuiidd() functions are always successful, and no return + value is reserved to indicate an error. + +SSEEEE AALLSSOO + getgid(2), setreuid(2) + +SSTTAANNDDAARRDDSS + GGeetteeuuiidd() and ggeettuuiidd() conform to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/intro.0 b/usr/share/man/cat2/intro.0 new file mode 100644 index 0000000000..ebfeb667d3 --- /dev/null +++ b/usr/share/man/cat2/intro.0 @@ -0,0 +1,550 @@ +INTRO(2) BSD Programmer's Manual INTRO(2) + +NNAAMMEE + iinnttrroo - introduction to system calls and error numbers + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + +DDEESSCCRRIIPPTTIIOONN + This section provides an overview of the system calls, their error re- + turns, and other common definitions and concepts. + +DDIIAAGGNNOOSSTTIICCSS + Nearly all of the system calls provide an error number in the external + variable _e_r_r_n_o, which is defined as: + + extern int errno + + When a system call detects an error, it returns an integer value indicat- + ing failure (usually -1) and sets the variable _e_r_r_n_o accordingly. Successful calls never set _e_r_r_n_o; once set, it remains un- + til another error occurs. It should only be examined after an error. + Note that a number of system calls overload the meanings of these error + numbers, and that the meanings must be interpreted according to the type + and circumstances of the call. + + The following is a complete list of the errors and their names as given + in <_s_y_s_/_e_r_r_n_o_._h>. + + 0 _E_r_r_o_r _0. Not used. + + 1 EPERM _O_p_e_r_a_t_i_o_n _n_o_t _p_e_r_m_i_t_t_e_d _. An attempt was made to perform an oper- + ation limited to processes with appropriate privileges or to the + owner of a file or other resources. + + 2 ENOENT _N_o _s_u_c_h _f_i_l_e _o_r _d_i_r_e_c_t_o_r_y. A component of a specified pathname + did not exist, or the pathname was an empty string. + + 3 ESRCH _N_o _s_u_c_h _p_r_o_c_e_s_s. No process could be found corresponding to that + specified by the given process ID. + + 4 EINTR _I_n_t_e_r_r_u_p_t_e_d _f_u_n_c_t_i_o_n _c_a_l_l. An asynchronous signal (such as SIGINT + or SIGQUIT) was caught by the process during the execution of an + interruptible function. If the signal handler performs a normal + return, the interrupted function call will seem to have returned + the error condition. + + 5 EIO _I_n_p_u_t_/_o_u_t_p_u_t _e_r_r_o_r. Some physical input or output error occurred. + This error not be reported until a subsequent operation on the + same file descriptor and may be lost (over written) by any subse- + quent errors. + + 6 ENXIO _N_o _s_u_c_h _d_e_v_i_c_e _o_r _a_d_d_r_e_s_s. Input or output on a special file re- + ferred to a device that did not exist, or made a request beyond + the limits of the device. This error may also occur when, for + example, a tape drive is not online or no disk pack is is loaded + on a drive. + + 7 E2BIG _A_r_g _l_i_s_t _t_o_o _l_o_n_g. The number of bytes used for the argument and + environment list of the new process exceeded the current limit of + 20480 bytes (NCARGS in <_s_y_s_/_p_a_r_a_m_._h>). + + 8 ENOEXEC _E_x_e_c _f_o_r_m_a_t _e_r_r_o_r. A request was made to execute a file that, + although it has the appropriate permissions, was not in the for- + + mat required for an executable file. + + 9 EBADF _B_a_d _f_i_l_e _d_e_s_c_r_i_p_t_o_r. A file descriptor argument was out of range, + referred to no open file, or a read (write) request was made to a + file that was only open for writing (reading). + + 10 ECHILD _N_o _c_h_i_l_d _p_r_o_c_e_s_s_e_s. A wait or waitpid function was executed by + a process that had no existing or unwaited-for child processes. + + 11 EDEADLK _R_e_s_o_u_r_c_e _d_e_a_d_l_o_c_k _a_v_o_i_d_e_d. An attempt was made to lock a sys- + tem resource that would have resulted in a deadlock situation. + + 12 ENOMEM _C_a_n_n_o_t _a_l_l_o_c_a_t_e _m_e_m_o_r_y. The new process image required more + memory than was allowed by the hardware or by system-imposed mem- + ory management constraints. A lack of swap space is normally + temporary; however, a lack of core is not. Soft limits may be + increased to their corresponding hard limits. + + 13 EACCES _P_e_r_m_i_s_s_i_o_n _d_e_n_i_e_d. An attempt was made to access a file in a + way forbidden by its file access permissions. + + 14 EFAULT _B_a_d _a_d_d_r_e_s_s. The system detected an invalid address in attempt- + ing to use an argument of a call. + + 15 ENOTBLK _N_o_t _a _b_l_o_c_k _d_e_v_i_c_e. A block device operation was attempted on + a non-block device or file. + + 16 EBUSY _R_e_s_o_u_r_c_e _b_u_s_y. An attempt to use a system resource which was in + use at the time in a manner which would have conflicted with the + request. + + 17 EEXIST _F_i_l_e _e_x_i_s_t_s. An existing file was mentioned in an inappropriate + context, for instance, as the new link name in a link function. + + 18 EXDEV _I_m_p_r_o_p_e_r _l_i_n_k. A hard link to a file on another file system was + attempted. + + 19 ENODEV _O_p_e_r_a_t_i_o_n _n_o_t _s_u_p_p_o_r_t_e_d _b_y _d_e_v_i_c_e. An attempt was made to apply + an inappropriate function to a device, for example, trying to + read a write-only device such as a printer. + + 20 ENOTDIR _N_o_t _a _d_i_r_e_c_t_o_r_y. A component of the specified pathname exist- + ed, but it was not a directory, when a directory was expected. + + 21 EISDIR _I_s _a _d_i_r_e_c_t_o_r_y. An attempt was made to open a directory with + write mode specified. + + 22 EINVAL _I_n_v_a_l_i_d _a_r_g_u_m_e_n_t. Some invalid argument was supplied. (For ex- + ample, specifying an undefined signal to a signal or kill func- + tion). + + 23 ENFILE _T_o_o _m_a_n_y _o_p_e_n _f_i_l_e_s _i_n _s_y_s_t_e_m. Maximum number of file descrip- + tors allowable on the system has been reached and a requests for + an open cannot be satisfied until at least one has been closed. + + 24 EMFILE _T_o_o _m_a_n_y _o_p_e_n _f_i_l_e_s. Getdtablesize(2) will obtain the + current limit. + + 25 ENOTTY _I_n_a_p_p_r_o_p_r_i_a_t_e _i_o_c_t_l _f_o_r _d_e_v_i_c_e. A control function (see + ioctl(2)) was attempted for a file or special device for which + the operation was inappropriate. + + 26 ETXTBSY _T_e_x_t _f_i_l_e _b_u_s_y. The new process was a pure procedure (shared + text) file which was open for writing by another process, or the + pure procedure file was being executed an open call requested + write access. + + 27 EFBIG _F_i_l_e _t_o_o _l_a_r_g_e. The size of a file exceeded the maximum (about + 2.1E9 bytes). + + 28 ENOSPC _D_e_v_i_c_e _o_u_t _o_f _s_p_a_c_e. A write to an ordinary file, the creation + of a directory or symbolic link, or the creation of a directory + entry failed because no more disk blocks are available on the + file system, or the allocation of an inode for a newly created + file failed because no more inodes are available on the file sys- + tem. + + 29 ESPIPE _I_l_l_e_g_a_l _s_e_e_k. An lseek function was issued on a socket, pipe or + FIFO. + + 30 EROFS _R_e_a_d_-_o_n_l_y _f_i_l_e _s_y_s_t_e_m. An attempt was made to modify a file or + directory was made on a file system that was read-only at the + time. + + 31 EMLINK _T_o_o _m_a_n_y _l_i_n_k_s. Maximum allowable hard links to a single file + has been exceeded (limit of 32767 hard links per file). + + 32 EPIPE _B_r_o_k_e_n _p_i_p_e. A write on a pipe, socket or FIFO for which there + is no process to read the data. + + 33 EDOM _N_u_m_e_r_i_c_a_l _a_r_g_u_m_e_n_t _o_u_t _o_f _d_o_m_a_i_n. A numerical input argument was + outside the defined domain of the mathematical function. + + 34 ERANGE _N_u_m_e_r_i_c_a_l _r_e_s_u_l_t _o_u_t _o_f _r_a_n_g_e. A numerical result of the func- + tion was to large to fit in the available space (perhaps exceeded + precision). + + 35 EAGAIN _R_e_s_o_u_r_c_e _t_e_m_p_o_r_a_r_i_l_y _u_n_a_v_a_i_l_a_b_l_e. This is a temporary condition + and later calls to the same routine may complete normally. + + 36 EINPROGRESS _O_p_e_r_a_t_i_o_n _n_o_w _i_n _p_r_o_g_r_e_s_s. An operation that takes a long + time to complete (such as a connect(2)) was attempted on a non- + blocking object (see fcntl(2)). + + 37 EALREADY _O_p_e_r_a_t_i_o_n _a_l_r_e_a_d_y _i_n _p_r_o_g_r_e_s_s. An operation was attempted on + a non-blocking object that already had an operation in progress. + + 38 ENOTSOCK _S_o_c_k_e_t _o_p_e_r_a_t_i_o_n _o_n _n_o_n_-_s_o_c_k_e_t. Self-explanatory. + + 39 EDESTADDRREQ _D_e_s_t_i_n_a_t_i_o_n _a_d_d_r_e_s_s _r_e_q_u_i_r_e_d. A required address was + omitted from an operation on a socket. + + 40 EMSGSIZE _M_e_s_s_a_g_e _t_o_o _l_o_n_g. A message sent on a socket was larger than + the internal message buffer or some other network limit. + + 41 EPROTOTYPE _P_r_o_t_o_c_o_l _w_r_o_n_g _t_y_p_e _f_o_r _s_o_c_k_e_t. A protocol was specified + that does not support the semantics of the socket type requested. + For example, you cannot use the ARPA Internet UDP protocol with + type SOCK_STREAM. + + 42 ENOPROTOOPT _P_r_o_t_o_c_o_l _n_o_t _a_v_a_i_l_a_b_l_e. A bad option or level was speci- + fied in a getsockopt(2) or setsockopt(2) call. + + 43 EPROTONOSUPPORT _P_r_o_t_o_c_o_l _n_o_t _s_u_p_p_o_r_t_e_d. The protocol has not been con- + figured into the system or no implementation for it exists. + + 44 ESOCKTNOSUPPORT _S_o_c_k_e_t _t_y_p_e _n_o_t _s_u_p_p_o_r_t_e_d. The support for the socket + type has not been configured into the system or no implementation + + + for it exists. + + 45 EOPNOTSUPP _O_p_e_r_a_t_i_o_n _n_o_t _s_u_p_p_o_r_t_e_d. The attempted operation is not + supported for the type of object referenced. Usually this occurs + when a file descriptor refers to a file or socket that cannot + support this operation, for example, trying to _a_c_c_e_p_t a connec- + tion on a datagram socket. + + 46 EPFNOSUPPORT _P_r_o_t_o_c_o_l _f_a_m_i_l_y _n_o_t _s_u_p_p_o_r_t_e_d. The protocol family has + not been configured into the system or no implementation for it + exists. + + 47 EAFNOSUPPORT _A_d_d_r_e_s_s _f_a_m_i_l_y _n_o_t _s_u_p_p_o_r_t_e_d _b_y _p_r_o_t_o_c_o_l _f_a_m_i_l_y. An ad- + dress incompatible with the requested protocol was used. For ex- + ample, you shouldn't necessarily expect to be able to use NS ad- + dresses with ARPA Internet protocols. + + 48 EADDRINUSE _A_d_d_r_e_s_s _a_l_r_e_a_d_y _i_n _u_s_e. Only one usage of each address is + normally permitted. + + 49 EADDRNOTAVAIL _C_a_n_n_o_t _a_s_s_i_g_n _r_e_q_u_e_s_t_e_d _a_d_d_r_e_s_s. Normally results from + an attempt to create a socket with an address not on this ma- + chine. + + 50 ENETDOWN _N_e_t_w_o_r_k _i_s _d_o_w_n. A socket operation encountered a dead net- + work. + + 51 ENETUNREACH _N_e_t_w_o_r_k _i_s _u_n_r_e_a_c_h_a_b_l_e. A socket operation was attempted + to an unreachable network. + + 52 ENETRESET _N_e_t_w_o_r_k _d_r_o_p_p_e_d _c_o_n_n_e_c_t_i_o_n _o_n _r_e_s_e_t. The host you were con- + nected to crashed and rebooted. + + 53 ECONNABORTED _S_o_f_t_w_a_r_e _c_a_u_s_e_d _c_o_n_n_e_c_t_i_o_n _a_b_o_r_t. A connection abort was + caused internal to your host machine. + + 54 ECONNRESET _C_o_n_n_e_c_t_i_o_n _r_e_s_e_t _b_y _p_e_e_r. A connection was forcibly closed + by a peer. This normally results from a loss of the connection + on the remote socket due to a timeout or a reboot. + + 55 ENOBUFS _N_o _b_u_f_f_e_r _s_p_a_c_e _a_v_a_i_l_a_b_l_e. An operation on a socket or pipe + was not performed because the system lacked sufficient buffer + space or because a queue was full. + + 56 EISCONN _S_o_c_k_e_t _i_s _a_l_r_e_a_d_y _c_o_n_n_e_c_t_e_d. A connect request was made on an + already connected socket; or, a sendto or sendmsg request on a + connected socket specified a destination when already connected. + + 57 ENOTCONN _S_o_c_k_e_t _i_s _n_o_t _c_o_n_n_e_c_t_e_d. An request to send or receive data + was disallowed because the socket is not connected and (when + sending on a datagram socket) no address was supplied. + + 58 ESHUTDOWN _C_a_n_n_o_t _s_e_n_d _a_f_t_e_r _s_o_c_k_e_t _s_h_u_t_d_o_w_n. A request to send data + was disallowed because the socket had already been shut down with + a previous shutdown(2) call. + + 60 ETIMEDOUT _C_o_n_n_e_c_t_i_o_n _t_i_m_e_d _o_u_t. A connect or send request failed be- + cause the connected party did not properly respond after a period + of time. (The timeout period is dependent on the communication + protocol.) + + 61 ECONNREFUSED _C_o_n_n_e_c_t_i_o_n _r_e_f_u_s_e_d. No connection could be made because + the target machine actively refused it. This usually results + from trying to connect to a service that is inactive on the for- + + + eign host. + + 62 ELOOP _T_o_o _m_a_n_y _l_e_v_e_l_s _o_f _s_y_m_b_o_l_i_c _l_i_n_k_s. A path name lookup involved + more than 8 symbolic links. + + 63 ENAMETOOLONG _F_i_l_e _n_a_m_e _t_o_o _l_o_n_g. A component of a path name exceeded + 255 (MAXNAMELEN) characters, or an entire path name exceeded 1023 + (MAXPATHLEN-1) characters. + + 64 EHOSTDOWN _H_o_s_t _i_s _d_o_w_n. A socket operation failed because the destina- + tion host was down. + + 65 EHOSTUNREACH _N_o _r_o_u_t_e _t_o _h_o_s_t. A socket operation was attempted to an + unreachable host. + + 66 ENOTEMPTY _D_i_r_e_c_t_o_r_y _n_o_t _e_m_p_t_y. A directory with entries other than `.' + and `..' was supplied to a remove directory or rename call. + + 67 EPROCLIM _T_o_o _m_a_n_y _p_r_o_c_e_s_s_e_s. + + 68 EUSERS _T_o_o _m_a_n_y _u_s_e_r_s. The quota system ran out of table entries. + + 69 EDQUOT _D_i_s_c _q_u_o_t_a _e_x_c_e_e_d_e_d. A write to an ordinary file, the creation + of a directory or symbolic link, or the creation of a directory + entry failed because the user's quota of disk blocks was exhaust- + ed, or the allocation of an inode for a newly created file failed + because the user's quota of inodes was exhausted. + + 70 ESTALE _S_t_a_l_e _N_F_S _f_i_l_e _h_a_n_d_l_e. An attempt was made to access an open + file (on an NFS filesystem) which is now unavailable as refer- + enced by the file descriptor. This may indicate the file was + deleted on the NFS server or some other catastrophic event oc- + curred. + + 72 EBADRPC _R_P_C _s_t_r_u_c_t _i_s _b_a_d. Exchange of RPC information was unsuccess- + ful. + + 73 ERPCMISMATCH _R_P_C _v_e_r_s_i_o_n _w_r_o_n_g. The version of RPC on the remote peer + is not compatible with the local version. + + 74 EPROGUNAVAIL _R_P_C _p_r_o_g_. _n_o_t _a_v_a_i_l. The requested program is not regis- + tered on the remote host. + + 75 EPROGMISMATCH _P_r_o_g_r_a_m _v_e_r_s_i_o_n _w_r_o_n_g. The requested version of the pro- + gram is not available on the remote host (RPC). + + 76 EPROCUNAVAIL _B_a_d _p_r_o_c_e_d_u_r_e _f_o_r _p_r_o_g_r_a_m. An RPC call was attempted for + a procedure which doesn't exist in the remote program. + + 77 ENOLCK _N_o _l_o_c_k_s _a_v_a_i_l_a_b_l_e. A system-imposed limit on the number of si- + multaneous file locks was reached. + + 78 ENOSYS _F_u_n_c_t_i_o_n _n_o_t _i_m_p_l_e_m_e_n_t_e_d. Attempted a system call that is not + available on this system. + +DDEEFFIINNIITTIIOONNSS + Process ID. + Each active process in the system is uniquely identified by a + non-negative integer called a process ID. The range of this ID + is from 0 to 30000. + + Parent process ID + A new process is created by a currently active process; (see + fork(2)). The parent process ID of a process is initially the + process ID of its creator. If the creating process exits, the + parent process ID of each child is set to the ID of a system pro- + + cess, init. + + Process Group + Each active process is a member of a process group that is iden- + tified by a non-negative integer called the process group ID. + This is the process ID of the group leader. This grouping per- + mits the signaling of related processes (see termios(4)) and the + job control mechanisms of csh(1). + + Session + A session is a set of one or more process groups. A session is + created by a successful call to setsid(2), which causes the + caller to become the only member of the only process group in the + new session. + + Session leader + A process that has created a new session by a successful call to + setsid(2), is known as a session leader. Only a session leader + may acquire a terminal as its controlling terminal (see + termios(4)). + + Controlling process + A session leader with a controlling terminal is a controlling + process. + + Controlling terminal + A terminal that is associated with a session is known as the con- + trolling terminal for that session and its members. + + Terminal Process Group ID + A terminal may be acquired by a session leader as its controlling + terminal. Once a terminal is associated with a session, any of + the process groups within the session may be placed into the + foreground by setting the terminal process group ID to the ID of + the process group. This facility is used to arbitrate between + multiple jobs contending for the same terminal; (see csh(1) and + tty(4)). + + Orphaned Process Group + A process group is considered to be _o_r_p_h_a_n_e_d if it is not under + the control of a job control shell. More precisely, a process + group is orphaned when none of its members has a parent process + that is in the same session as the group, but is in a different + process group. Note that when a process exits, the parent pro- + cess for its children is changed to be init, which is in a sepa- + rate session. Not all members of an orphaned process group are + necessarily orphaned processes (those whose creating process has + exited). The process group of a session leader is orphaned by + definition. + + Real User ID and Real Group ID + Each user on the system is identified by a positive integer + termed the real user ID. + + Each user is also a member of one or more groups. One of these + groups is distinguished from others and used in implementing ac- + counting facilities. The positive integer corresponding to this + distinguished group is termed the real group ID. + + All processes have a real user ID and real group ID. These are + initialized from the equivalent attributes of the process that + created it. + + Effective User Id, Effective Group Id, and Group Access List + Access to system resources is governed by two values: the effec- + tive user ID, and the group access list. The first member of the + group access list is also known as the effective group ID. (In + POSIX.1, the group access list is known as the set of supplemen- + tary group IDs, and it is unspecified whether the effective group + ID is a member of the list.) + + The effective user ID and effective group ID are initially the + process's real user ID and real group ID respectively. Either + may be modified through execution of a set-user-ID or set-group- + ID file (possibly by one its ancestors) (see execve(2)). By con- + vention, the effective group ID (the first member of the group + access list) is duplicated, so that the execution of a set-group- + ID program does not result in the loss of the original (real) + group ID. + + The group access list is a set of group IDs used only in deter- + mining resource accessibility. Access checks are performed as + described below in ``File Access Permissions''. + + Saved Set User ID and Saved Set Group ID + When a process executes a new file, the effective user ID is set + to the owner of the file if the file is set-user-ID, and the ef- + fective group ID (first element of the group access list) is set + to the group of the file if the file is set-group-ID. The effec- + tive user ID of the process is then recorded as the saved set- + user-ID, and the effective group ID of the process is recorded as + the saved set-group-ID. These values may be used to regain those + values as the effective user or group ID after reverting to the + real ID (see setuid(2)). (In POSIX.1, the saved set-user-ID and + saved set-group-ID are optional, and are used in setuid and set- + gid, but this does not work as desired for the super-user.) + + Super-user + A process is recognized as a _s_u_p_e_r_-_u_s_e_r process and is granted + special privileges if its effective user ID is 0. + + Special Processes + The processes with process IDs of 0, 1, and 2 are special. Pro- + cess 0 is the scheduler. Process 1 is the initialization process + init, and is the ancestor of every other process in the system. + It is used to control the process structure. Process 2 is the + paging daemon. + + Descriptor + An integer assigned by the system when a file is referenced by + open(2) or dup(2), or when a socket is created by pipe(2), + socket(2) or socketpair(2), which uniquely identifies an access + path to that file or socket from a given process or any of its + children. + + File Name + Names consisting of up to 255 (MAXNAMELEN) characters may be used + to name an ordinary file, special file, or directory. + + These characters may be selected from the set of all ASCII char- + acter excluding 0 (NUL) and the ASCII code for `/' (slash). (The + parity bit, bit 7, must be 0.) + + Note that it is generally unwise to use `*', `?', `[' or `]' as + part of file names because of the special meaning attached to + these characters by the shell. + + Path Name + A path name is a NUL-terminated character string starting with an + optional slash `/', followed by zero or more directory names sep- + arated by slashes, optionally followed by a file name. The total + length of a path name must be less than 1024 (MAXPATHLEN) charac- + ters. + + If a path name begins with a slash, the path search begins at the + _r_o_o_t directory. Otherwise, the search begins from the current + working directory. A slash by itself names the root directory. + An empty pathname refers to the current directory. + + Directory + A directory is a special type of file that contains entries that + are references to other files. Directory entries are called + links. By convention, a directory contains at least two links, + `.' and `..', referred to as _d_o_t and _d_o_t_-_d_o_t respectively. Dot + refers to the directory itself and dot-dot refers to its parent + directory. + + Root Directory and Current Working Directory + Each process has associated with it a concept of a root directory + and a current working directory for the purpose of resolving path + name searches. A process's root directory need not be the root + directory of the root file system. + + File Access Permissions + Every file in the file system has a set of access permissions. + These permissions are used in determining whether a process may + perform a requested operation on the file (such as opening a file + for writing). Access permissions are established at the time a + file is created. They may be changed at some later time through + the chmod(2) call. + + File access is broken down according to whether a file may be: + read, written, or executed. Directory files use the execute per- + mission to control if the directory may be searched. + + File access permissions are interpreted by the system as they ap- + ply to three different classes of users: the owner of the file, + those users in the file's group, anyone else. Every file has an + independent set of access permissions for each of these classes. + When an access check is made, the system decides if permission + should be granted by checking the access information applicable + to the caller. + + Read, write, and execute/search permissions on a file are granted + to a process if: + + The process's effective user ID is that of the super-user. (Note: + even the super-user cannot execute a non-executable file.) + + The process's effective user ID matches the user ID of the owner + of the file and the owner permissions allow the access. + + The process's effective user ID does not match the user ID of the + owner of the file, and either the process's effective group ID + matches the group ID of the file, or the group ID of the file is + in the process's group access list, and the group permissions al- + low the access. + + Neither the effective user ID nor effective group ID and group + access list of the process match the corresponding user ID and + group ID of the file, but the permissions for ``other users'' al- + low access. + + Otherwise, permission is denied. + + Sockets and Address Families + + + A socket is an endpoint for communication between processes. + Each socket has queues for sending and receiving data. + + Sockets are typed according to their communications properties. + These properties include whether messages sent and received at a + socket require the name of the partner, whether communication is + reliable, the format used in naming message recipients, etc. + + Each instance of the system supports some collection of socket + types; consult socket(2) for more information about the types + available and their properties. + + Each instance of the system supports some number of sets of com- + munications protocols. Each protocol set supports addresses of a + certain format. An Address Family is the set of addresses for a + specific group of protocols. Each socket has an address chosen + from the address family in which the socket was created. + +SSEEEE AALLSSOO + intro(3), perror(3) + +4th Berkeley Distribution June 4, 1993 9 diff --git a/usr/share/man/cat2/ioctl.0 b/usr/share/man/cat2/ioctl.0 new file mode 100644 index 0000000000..d3f4ddc236 --- /dev/null +++ b/usr/share/man/cat2/ioctl.0 @@ -0,0 +1,45 @@ +IOCTL(2) BSD Programmer's Manual IOCTL(2) + +NNAAMMEE + iiooccttll - control device + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iiooccttll(_i_n_t _d, _u_n_s_i_g_n_e_d _l_o_n_g _r_e_q_u_e_s_t, _c_h_a_r _*_a_r_g_p); + +DDEESSCCRRIIPPTTIIOONN + The iiooccttll() function manipulates the underlying device parameters of spe- + cial files. In particular, many operating characteristics of character + special files (e.g. terminals) may be controlled with iiooccttll() requests. + The argument _d must be an open file descriptor. + + An ioctl _r_e_q_u_e_s_t has encoded in it whether the argument is an ``in'' pa- + rameter or ``out'' parameter, and the size of the argument _a_r_g_p in bytes. + Macros and defines used in specifying an ioctl _r_e_q_u_e_s_t are located in the + file <_s_y_s_/_i_o_c_t_l_._h>. + +RREETTUURRNN VVAALLUUEESS + If an error has occurred, a value of -1 is returned and _e_r_r_n_o is set to + indicate the error. + +EERRRROORRSS + IIooccttll() will fail: + + [EBADF] _d is not a valid descriptor. + + [ENOTTY] _d is not associated with a character special device. + + [ENOTTY] The specified request does not apply to the kind of object that + the descriptor _d references. + + [EINVAL] _R_e_q_u_e_s_t or _a_r_g_p is not valid. + +SSEEEE AALLSSOO + mt(1), execve(2), fcntl(2), tty(4), intro(4) + +HHIISSTTOORRYY + An iiooccttll function call appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/kill.0 b/usr/share/man/cat2/kill.0 new file mode 100644 index 0000000000..5f6a3e066b --- /dev/null +++ b/usr/share/man/cat2/kill.0 @@ -0,0 +1,72 @@ +KILL(2) BSD Programmer's Manual KILL(2) + +NNAAMMEE + kkiillll - send signal to a process + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + kkiillll(_p_i_d___t _p_i_d, _i_n_t _s_i_g); + +DDEESSCCRRIIPPTTIIOONN + The kkiillll() function sends the signal given by _s_i_g to _p_i_d, a process or a + group of processes. _S_i_g may be one of the signals specified in sigac- + tion(2) or it may be 0, in which case error checking is performed but no + signal is actually sent. This can be used to check the validity of _p_i_d. + + For a process to have permission to send a signal to a process designated + by _p_i_d, the real or effective user ID of the receving process must match + that of the sending process or the user must have appropriate privileges + (such as given by a set-user-ID program or the user is the super-user). + A single exception is the signal SIGCONT, which may always be sent to any + descendant of the current process. + + If _p_i_d is greater than zero: + _S_i_g is sent to the process whose ID is equal to _p_i_d_. + + If _p_i_d is zero: + _S_i_g is sent to all processes whose group ID is equal to the pro- + cess group ID of the sender, and for which the process has per- + mission; this is a variant of killpg(2). + + If _p_i_d is -1: + If the user has super user privileges, the signal is sent to all + processes excluding system processes and the process sending the + signal. If the user is not the super user, the signal is sent to + all processes with the same uid as the user excluding the process + sending the signal. No error is returned if any process could be + signaled. + + For compatibility with System V, if the process number is negative but + not -1, the signal is sent to all processes whose process group ID is + equal to the absolute value of the process number. This is a variant of + killpg(2). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + KKiillll() will fail and no signal will be sent if: + + [EINVAL] _S_i_g is not a valid signal number. + + [ESRCH] No process can be found corresponding to that specified by _p_i_d. + + [ESRCH] The process id was given as 0 but the sending process does not + have a process group. + + [EPERM] The sending process is not the super-user and its effective us- + er id does not match the effective user-id of the receiving + process. When signaling a process group, this error is re- + turned if any members of the group could not be signaled. + +SSEEEE AALLSSOO + getpid(2), getpgrp(2), killpg(2), sigaction(2) + +SSTTAANNDDAARRDDSS + The kkiillll() function is expected to conform to IEEE Std 1003.1-1988 + (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/killpg.0 b/usr/share/man/cat2/killpg.0 new file mode 100644 index 0000000000..6bd2b3e0e0 --- /dev/null +++ b/usr/share/man/cat2/killpg.0 @@ -0,0 +1,48 @@ +KILLPG(2) BSD Programmer's Manual KILLPG(2) + +NNAAMMEE + kkiillllppgg - send signal to a process group + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + kkiillllppgg(_p_i_d___t _p_g_r_p, _i_n_t _s_i_g); + +DDEESSCCRRIIPPTTIIOONN + KKiillllppgg() sends the signal _s_i_g to the process group _p_g_r_p. See sigaction(2) + for a list of signals. If _p_g_r_p is 0, kkiillllppgg() sends the signal to the + sending process's process group. + + The sending process and members of the process group must have the same + effective user ID, or the sender must be the super-user. As a single + special case the continue signal SIGCONT may be sent to any process that + is a descendant of the current process. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + KKiillllppgg() will fail and no signal will be sent if: + + [EINVAL] _S_i_g is not a valid signal number. + + [ESRCH] No process can be found in the process group specified by + _p_g_r_p. + + [ESRCH] The process group was given as 0 but the sending process + does not have a process group. + + [EPERM] The sending process is not the super-user and one or more + of the target processes has an effective user ID different + from that of the sending process. + +SSEEEE AALLSSOO + kill(2), getpgrp(2), sigaction(2) + +HHIISSTTOORRYY + The kkiillllppgg function call appeared in 4.0BSD. + +4th Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/ktrace.0 b/usr/share/man/cat2/ktrace.0 new file mode 100644 index 0000000000..ef9fa87133 --- /dev/null +++ b/usr/share/man/cat2/ktrace.0 @@ -0,0 +1,98 @@ +KTRACE(2) BSD Programmer's Manual KTRACE(2) + +NNAAMMEE + kkttrraaccee - process tracing + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + kkttrraaccee(_c_o_n_s_t _c_h_a_r _*_t_r_a_c_e_f_i_l_e, _i_n_t _o_p_s, _i_n_t _t_r_p_o_i_n_t_s, _i_n_t _p_i_d); + +DDEESSCCRRIIPPTTIIOONN + The kkttrraaccee() function enables or disables tracing of one or more process- + es. Users may only trace their own processes. Only the super-user can + trace setuid or setgid programs. + + The _t_r_a_c_e_f_i_l_e gives the pathname of the file to be used for tracing. The + file must exist and be writable by the calling process. All trace + records are always appended to the file, so the file must be truncated to + zero length to discard previous trace data. If tracing points are being + disabled (see KTROP_CLEAR below), _t_r_a_c_e_f_i_l_e may be NULL. + + The ooppss parameter specifies the requested ktrace operation. The defined + operations are: + + KTROP_SET Enable trace points specified in _t_r_p_o_i_n_t_s. + KTROP_CLEAR Disable trace points specified in _t_r_p_o_i_n_t_s. + KTROP_CLEARFILE Stop all tracing. + KTRFLAG_DESCEND The tracing change should apply to the speci- + fied process and all its current children. + + The ttrrppooiinnttss parameter specifies the trace points of interest. The de- + fined trace points are: + + KTRFAC_SYSCALL Trace system calls. + KTRFAC_SYSRET Trace return values from system calls. + KTRFAC_NAMEI Trace name lookup operations. + KTRFAC_GENIO Trace all I/O (note that this option can gen- + erate much output). + KTRFAC_PSIG Trace posted signals. + KTRFAC_CSW Trace context switch points. + KTRFAC_INHERIT Inherit tracing to future children. + + Each tracing event outputs a record composed of a generic header followed + by a trace point specific structure. The generic header is: + + struct ktr_header { + int ktr_len; /* length of buf */ + short ktr_type; /* trace record type */ + pid_t ktr_pid; /* process id */ + char ktr_comm[MAXCOMLEN+1]; /* command name */ + struct timeval ktr_time; /* timestamp */ + caddr_t ktr_buf; + }; + + The kkttrr__lleenn field specifies the length of the kkttrr__ttyyppee data that follows + this header. The kkttrr__ppiidd and kkttrr__ccoommmm fields specify the process and + command generating the record. The kkttrr__ttiimmee field gives the time (with + microsecond resolution) that the record was generated. The kkttrr__bbuuff is an + internal kernel pointer and is not useful. + + The generic header is followed by kkttrr__lleenn bytes of a kkttrr__ttyyppee record. + The type specific records are defined in the _<_s_y_s_/_k_t_r_a_c_e_._h_> include file. + +RREETTUURRNN VVAALLUUEESS + On successful completion a value of 0 is returned. Otherwise, a value of + -1 is returned and _e_r_r_n_o is set to show the error. + +EERRRROORRSS + KKttrraaccee() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named tracefile does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + +SSEEEE AALLSSOO + ktrace(1), kdump(1) + +HHIISSTTOORRYY + A kkttrraaccee function call first appeared in 4.4BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/link.0 b/usr/share/man/cat2/link.0 new file mode 100644 index 0000000000..7ad2cdcc91 --- /dev/null +++ b/usr/share/man/cat2/link.0 @@ -0,0 +1,88 @@ +LINK(2) BSD Programmer's Manual LINK(2) + +NNAAMMEE + lliinnkk - make a hard file link + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + lliinnkk(_c_o_n_s_t _c_h_a_r _*_n_a_m_e_1, _c_o_n_s_t _c_h_a_r _*_n_a_m_e_2); + +DDEESSCCRRIIPPTTIIOONN + The lliinnkk() function call atomically creates the specified directory entry + (hard link) _n_a_m_e_2 with the attributes of the underlying object pointed at + by _n_a_m_e_1 If the link is successful: the link count of the underlying ob- + ject is incremented; _n_a_m_e_1 and _n_a_m_e_2 share equal access and rights to the + underlying object. + + If _n_a_m_e_1 is removed, the file _n_a_m_e_2 is not deleted and the link count of + the underlying object is decremented. + + _N_a_m_e_1 must exist for the hard link to succeed and both _n_a_m_e_1 and _n_a_m_e_2 + must be in the same file system. Unless the caller is the super-user, + _n_a_m_e_1 may not be a directory. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + LLiinnkk() will fail and no link will be created if: are true: + + [ENOTDIR] A component of either path prefix is not a directory. + + [EINVAL] Either pathname contains a character with the high-order + bit set. + + [ENAMETOOLONG] + A component of either pathname exceeded 255 characters, or + entire length of either path name exceeded 1023 characters. + + [ENOENT] A component of either path prefix does not exist. + + [EACCES] A component of either path prefix denies search permission. + + [EACCES] The requested link requires writing in a directory with a + mode that denies write permission. + + [ELOOP] Too many symbolic links were encountered in translating one + of the pathnames. + + [ENOENT] The file named by _n_a_m_e_1 does not exist. + + [EEXIST] The link named by _n_a_m_e_2 does exist. + + [EPERM] The file named by _n_a_m_e_1 is a directory and the effective + user ID is not super-user. + + [EXDEV] The link named by _n_a_m_e_2 and the file named by _n_a_m_e_1 are on + different file systems. + + [ENOSPC] The directory in which the entry for the new link is being + placed cannot be extended because there is no space left on + + + the file system containing the directory. + + [EDQUOT] The directory in which the entry for the new link is being + placed cannot be extended because the user's quota of disk + blocks on the file system containing the directory has been + exhausted. + + [EIO] An I/O error occurred while reading from or writing to the + file system to make the directory entry. + + [EROFS] The requested link requires writing in a directory on a + read-only file system. + + [EFAULT] One of the pathnames specified is outside the process's al- + located address space. + +SSEEEE AALLSSOO + symlink(2), unlink(2) + +SSTTAANNDDAARRDDSS + LLiinnkk() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/listen.0 b/usr/share/man/cat2/listen.0 new file mode 100644 index 0000000000..dc85f4fdf9 --- /dev/null +++ b/usr/share/man/cat2/listen.0 @@ -0,0 +1,47 @@ +LISTEN(2) BSD Programmer's Manual LISTEN(2) + +NNAAMMEE + lliisstteenn - listen for connections on a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + lliisstteenn(_i_n_t _s, _i_n_t _b_a_c_k_l_o_g); + +DDEESSCCRRIIPPTTIIOONN + To accept connections, a socket is first created with socket(2), a will- + ingness to accept incoming connections and a queue limit for incoming + connections are specified with lliisstteenn(), and then the connections are ac- + cepted with accept(2). The lliisstteenn() call applies only to sockets of type + SOCK_STREAM or SOCK_SEQPACKET. + + The _b_a_c_k_l_o_g parameter defines the maximum length the queue of pending + connections may grow to. If a connection request arrives with the queue + full the client may receive an error with an indication of ECONNREFUSED, + or, if the underlying protocol supports retransmission, the request may + be ignored so that retries may succeed. + +RREETTUURRNN VVAALLUUEESS + A 0 return value indicates success; -1 indicates an error. + +EERRRROORRSS + LLiisstteenn(_w_i_l_l, _f_a_i_l, _i_f_:) + + [EBADF] The argument _s is not a valid descriptor. + + [ENOTSOCK] The argument _s is not a socket. + + [EOPNOTSUPP] The socket is not of a type that supports the operation + lliisstteenn(). + +SSEEEE AALLSSOO + accept(2), connect(2), socket(2) + +BBUUGGSS + The _b_a_c_k_l_o_g is currently limited (silently) to 5. + +HHIISSTTOORRYY + The lliisstteenn function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/lseek.0 b/usr/share/man/cat2/lseek.0 new file mode 100644 index 0000000000..3b095d3fd2 --- /dev/null +++ b/usr/share/man/cat2/lseek.0 @@ -0,0 +1,58 @@ +LSEEK(2) BSD Programmer's Manual LSEEK(2) + +NNAAMMEE + llsseeeekk - reposition read/write file offset + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _o_f_f___t + llsseeeekk(_i_n_t _f_i_l_d_e_s, _o_f_f___t _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + +DDEESSCCRRIIPPTTIIOONN + The llsseeeekk() function repositions the offset of the file descriptor _f_i_l_d_e_s + to the argument _o_f_f_s_e_t according to the directive _w_h_e_n_c_e_. The argument + _f_i_l_d_e_s must be an open file descriptor. LLsseeeekk() repositions the file + pointer _f_i_l_d_e_s as follows: + + If _w_h_e_n_c_e is SEEK_SET, the offset is set to _o_f_f_s_e_t bytes. + + If _w_h_e_n_c_e is SEEK_CUR, the offset is set to its current location + plus _o_f_f_s_e_t bytes. + + If _w_h_e_n_c_e is SEEK_END, the offset is set to the size of the file + plus _o_f_f_s_e_t bytes. + + The llsseeeekk() function allows the file offset to be set beyond the end of + the existing end-of-file of the file. If data is later written at this + point, subsequent reads of the data in the gap return bytes of zeros (un- + til data is actualy written into the gap). + + Some devices are incapable of seeking. The value of the pointer associ- + ated with such a device is undefined. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, llsseeeekk() returns the resulting offset location + as measured in bytes from the begining of the file. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + LLsseeeekk() will fail and the file pointer will remain unchanged if: + + [EBADF] _F_i_l_d_e_s is not an open file descriptor. + + [ESPIPE] _F_i_l_d_e_s is associated with a pipe, socket, or FIFO. + + [EINVAL] _W_h_e_n_c_e is not a proper value. + +SSEEEE AALLSSOO + dup(2), open(2) + +BBUUGGSS + This document's use of _w_h_e_n_c_e is incorrect English, but maintained for + historical reasons. + +SSTTAANNDDAARRDDSS + The llsseeeekk() function conforms to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/lstat.0 b/usr/share/man/cat2/lstat.0 new file mode 100644 index 0000000000..80cf30d689 --- /dev/null +++ b/usr/share/man/cat2/lstat.0 @@ -0,0 +1,157 @@ +STAT(2) BSD Programmer's Manual STAT(2) + +NNAAMMEE + ssttaatt, llssttaatt, ffssttaatt - get file status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + llssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + ffssttaatt(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + The ssttaatt() function obtains information about the file pointed to by + _p_a_t_h. Read, write or execute permission of the named file is not re- + quired, but all directories listed in the path name leading to the file + must be seachable. + + LLssttaatt() is like ssttaatt() except in the case where the named file is a sym- + bolic link, in which case llssttaatt() returns information about the link, + while ssttaatt() returns information about the file the link references. Un- + like other filesystem objects, symbolic links do not have an owner, + group, access mode, times, etc. Instead, these attributes are taken from + the directory that contains the link. The only attributes returned from + an llssttaatt() that refer to the symbolic link itself are the file type + (S_IFLNK), size, blocks, and link count (always 1). + + The ffssttaatt() obtains the same information about an open file known by the + file descriptor _f_d, such as would be obtained by an open call. + + _B_u_f is a pointer to a ssttaatt() structure as defined by <_s_y_s_/_s_t_a_t_._h> (shown + below) and into which information is placed concerning the file. + + struct stat { + dev_t st_dev; /* device inode resides on */ + ino_t st_ino; /* inode's number */ + mode_t st_mode; /* inode protection mode */ + nlink_t st_nlink; /* number or hard links to the file */ + uid_t st_uid; /* user-id of owner */ + gid_t st_gid; /* group-id of owner */ + dev_t st_rdev; /* device type, for special file inode */ + off_t st_size; /* file size, in bytes */ + time_t st_atime; /* time of last access */ + long st_spare1; + time_t st_mtime; /* time of last data modification */ + long st_spare2; + time_t st_ctime; /* time of last file status change */ + long st_spare3; + long st_blksize;/* optimal file sys I/O ops blocksize */ + long st_blocks; /* blocks allocated for file */ + u_long st_flags; /* user defined flags for file */ + u_long st_gen; /* file generation number */ + }; + + The time-related fields of _s_t_r_u_c_t _s_t_a_t are as follows: + + st_atime Time when file data last accessed. Changed by the following + + + system calls: mknod(2), utimes(2), and read(2). + + st_mtime Time when file data last modified. Changed by the following + system calls: mknod(2), utimes(2), write(2). + + st_ctime Time when file status was last changed (inode data modifica- + tion). Changed by the following system calls: chmod(2) + chown(2), link(2), mknod(2), rename(2), unlink(2), + utimes(2), write(2). + + st_blocks The actual number of blocks allocated for the file in 512-byte + units. + + The status information word _s_t___m_o_d_e has bits: + + #define S_IFMT 0170000 /* type of file */ + #define S_IFIFO 0010000 /* named pipe (fifo) */ + #define S_IFCHR 0020000 /* character special */ + #define S_IFDIR 0040000 /* directory */ + #define S_IFBLK 0060000 /* block special */ + #define S_IFREG 0100000 /* regular */ + #define S_IFLNK 0120000 /* symbolic link */ + #define S_IFSOCK 0140000 /* socket */ + #define S_ISUID 0004000 /* set user id on execution */ + #define S_ISGID 0002000 /* set group id on execution */ + #define S_ISVTX 0001000 /* save swapped text even after use */ + #define S_IRUSR 0000400 /* read permission, owner */ + #define S_IWUSR 0000200 /* write permission, owner */ + #define S_IXUSR 0000100 /* execute/search permission, owner */ + + For a list of access modes, see <_s_y_s_/_s_t_a_t_._h>, access(2) and chmod(2). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSttaatt() and llssttaatt() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EFAULT] _B_u_f or _n_a_m_e points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + + FFssttaatt() will fail if: + + [EBADF] _f_d is not a valid open file descriptor. + + + + [EFAULT] _B_u_f points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the file + system. + +CCAAVVEEAATT + The fields in the stat structure currently marked _s_t___s_p_a_r_e_1, _s_t___s_p_a_r_e_2, + and _s_t___s_p_a_r_e_3 are present in preparation for inode time stamps expanding + to 64 bits. This, however, can break certain programs that depend on the + time stamps being contiguous (in calls to utimes(2)). + +SSEEEE AALLSSOO + chmod(2), chown(2), utimes(2) symlink(7) + +BBUUGGSS + Applying fstat to a socket (and thus to a pipe) returns a zero'd buffer, + except for the blocksize field, and a unique device and inode number. + +SSTTAANNDDAARRDDSS + The ssttaatt() and ffssttaatt() function calls are expected to conform to IEEE Std + 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + A llssttaatt function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/madvise.0 b/usr/share/man/cat2/madvise.0 new file mode 100644 index 0000000000..2f4fe0bd2b --- /dev/null +++ b/usr/share/man/cat2/madvise.0 @@ -0,0 +1,27 @@ +MADVISE(2) BSD Programmer's Manual MADVISE(2) + +NNAAMMEE + mmaaddvviissee - give advise about use of memory + +SSYYNNOOPPSSIISS + mmaaddvviissee(_c_a_d_d_r___t _a_d_d_r, _i_n_t _l_e_n, _i_n_t _b_e_h_a_v); + +DDEESSCCRRIIPPTTIIOONN + The mmaaddvviissee() system call allows a process that has knowledge of its mem- + ory behavior to describe it to the system. The known behaviors are given + in _<_s_y_s_/_m_m_a_n_._h_>: + + #define MADV_NORMAL 0 /* no further special treatment */ + #define MADV_RANDOM 1 /* expect random page references */ + #define MADV_SEQUENTIAL 2 /* expect sequential references */ + #define MADV_WILLNEED 3 /* will need these pages */ + #define MADV_DONTNEED 4 /* don't need these pages */ + #define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ + +SSEEEE AALLSSOO + msync(2), munmap(2), mprotect(2), mincore(2) + +HHIISSTTOORRYY + The mmaaddvviissee function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/mincore.0 b/usr/share/man/cat2/mincore.0 new file mode 100644 index 0000000000..84c3341ccf --- /dev/null +++ b/usr/share/man/cat2/mincore.0 @@ -0,0 +1,21 @@ +MINCORE(2) BSD Programmer's Manual MINCORE(2) + +NNAAMMEE + mmiinnccoorree - get advise about use of memory + +SSYYNNOOPPSSIISS + mmiinnccoorree(_c_a_d_d_r___t _a_d_d_r, _i_n_t _l_e_n, _c_h_a_r _*_v_e_c); + +DDEESSCCRRIIPPTTIIOONN + The mmiinnccoorree() system call allows a process to obtain information about + whether pages are core resident. Here the current core residency of the + pages is returned in the character array _v_e_c, with a value of 1 meaning + that the page is in-core. + +SSEEEE AALLSSOO + msync(2), munmap(2), mprotect(2), madvise(2), + +HHIISSTTOORRYY + The mmiinnccoorree() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/mkdir.0 b/usr/share/man/cat2/mkdir.0 new file mode 100644 index 0000000000..fc6f51b709 --- /dev/null +++ b/usr/share/man/cat2/mkdir.0 @@ -0,0 +1,89 @@ +MKDIR(2) BSD Programmer's Manual MKDIR(2) + +NNAAMMEE + mmkkddiirr - make a directory file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + mmkkddiirr(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + The directory _p_a_t_h is created with the access permissions specified by + _m_o_d_e and restricted by the the umask(2) of the calling process. + + The directory's owner ID is set to the process's effective user ID. The + directory's group ID is set to that of the parent directory in which it + is created. + +RREETTUURRNN VVAALLUUEESS + A 0 return value indicates success. A -1 return value indicates an er- + ror, and an error code is stored in _e_r_r_n_o. + +EERRRROORRSS + MMkkddiirr() will fail and no directory will be created if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] A component of the path prefix does not exist. + + [EACCES] Search permission is denied for a component of the path pre- + fix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The _p_a_t_h argument contains a byte with the high-order bit + set. + + [EROFS] The named file resides on a read-only file system. + + [EEXIST] The named file exists. + + [ENOSPC] The directory in which the entry for the new directory is be- + ing placed cannot be extended because there is no space left + on the file system containing the directory. + + [ENOSPC] The new directory cannot be created because there there is no + space left on the file system that will contain the directo- + ry. + + [ENOSPC] There are no free inodes on the file system on which the di- + rectory is being created. + + [EDQUOT] The directory in which the entry for the new directory is be- + ing placed cannot be extended because the user's quota of + disk blocks on the file system containing the directory has + + been exhausted. + + [EDQUOT] The new directory cannot be created because the user's quota + of disk blocks on the file system that will contain the di- + rectory has been exhausted. + + [EDQUOT] The user's quota of inodes on the file system on which the + directory is being created has been exhausted. + + [EIO] An I/O error occurred while making the directory entry or al- + locating the inode. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + +SSEEEE AALLSSOO + chmod(2), stat(2), umask(2) + +SSTTAANNDDAARRDDSS + MMkkddiirr() conforms to IEEE Std 1003.1-1988 (``POSIX''). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/mkfifo.0 b/usr/share/man/cat2/mkfifo.0 new file mode 100644 index 0000000000..0d237e34ff --- /dev/null +++ b/usr/share/man/cat2/mkfifo.0 @@ -0,0 +1,85 @@ +MKFIFO(2) BSD Programmer's Manual MKFIFO(2) + +NNAAMMEE + mmkkffiiffoo - make a fifo file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + mmkkffiiffoo(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + MMkkffiiffoo() creates a new fifo file with name _p_a_t_h. The access permissions + are specified by _m_o_d_e and restricted by the umask(2) of the calling pro- + cess. + + The fifo's owner ID is set to the process's effective user ID. The fi- + fo's group ID is set to that of the parent directory in which it is cre- + ated. + +RREETTUURRNN VVAALLUUEESS + A 0 return value indicates success. A -1 return value indicates an er- + ror, and an error code is stored in _e_r_r_n_o. + +EERRRROORRSS + MMkkffiiffoo() will fail and no fifo will be created if: + + [ENOTSUPP] The kernel has not been configured to support fifo's. + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] A component of the path prefix does not exist. + + [EACCES] Search permission is denied for a component of the path pre- + fix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The _p_a_t_h argument contains a byte with the high-order bit + set. + + [EROFS] The named file resides on a read-only file system. + + [EEXIST] The named file exists. + + [ENOSPC] The directory in which the entry for the new fifo is being + placed cannot be extended because there is no space left on + the file system containing the directory. + + [ENOSPC] There are no free inodes on the file system on which the fifo + is being created. + + [EDQUOT] The directory in which the entry for the new fifo is being + placed cannot be extended because the user's quota of disk + blocks on the file system containing the directory has been + + + exhausted. + + [EDQUOT] The user's quota of inodes on the file system on which the + fifo is being created has been exhausted. + + [EIO] An I/O error occurred while making the directory entry or al- + locating the inode. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + +SSEEEE AALLSSOO + chmod(2), stat(2), umask(2) + +SSTTAANNDDAARRDDSS + The mmkkffiiffoo function call conforms to IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat2/mknod.0 b/usr/share/man/cat2/mknod.0 new file mode 100644 index 0000000000..73e7e4946b --- /dev/null +++ b/usr/share/man/cat2/mknod.0 @@ -0,0 +1,84 @@ +MKNOD(2) BSD Programmer's Manual MKNOD(2) + +NNAAMMEE + mmkknnoodd - make a special file node + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + mmkknnoodd(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _m_o_d_e___t _m_o_d_e, _d_e_v___t _d_e_v); + +DDEESSCCRRIIPPTTIIOONN + The device special file _p_a_t_h is created with the major and minor device + numbers extracted from _m_o_d_e_. The access permissions of _p_a_t_h are descen- + dant from the umask(2) of the parent process. + + If _m_o_d_e indicates a block or character special file, _d_e_v is a configura- + tion dependent specification of a character or block I/O device and the + superblock of the device. If _m_o_d_e does not indicate a block special or + character special device, _d_e_v is ignored. + + MMkknnoodd() requires super-user privileges. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + MMkknnoodd() will fail and the file will be not created if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] A component of the path prefix does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The process's effective user ID is not super-user. + + [EPERM] The pathname contains a character with the high-order bit + set. + + [EIO] An I/O error occurred while making the directory entry or + allocating the inode. + + [ENOSPC] The directory in which the entry for the new node is being + placed cannot be extended because there is no space left on + the file system containing the directory. + + [ENOSPC] There are no free inodes on the file system on which the + node is being created. + + [EDQUOT] The directory in which the entry for the new node is being + placed cannot be extended because the user's quota of disk + blocks on the file system containing the directory has been + + exhausted. + + [EDQUOT] The user's quota of inodes on the file system on which the + node is being created has been exhausted. + + [EROFS] The named file resides on a read-only file system. + + [EEXIST] The named file exists. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + +SSEEEE AALLSSOO + chmod(2), stat(2), umask(2) + +HHIISSTTOORRYY + A mmkknnoodd function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/mlock.0 b/usr/share/man/cat2/mlock.0 new file mode 100644 index 0000000000..2e37d9f31f --- /dev/null +++ b/usr/share/man/cat2/mlock.0 @@ -0,0 +1,87 @@ +MLOCK(2) BSD Programmer's Manual MLOCK(2) + +NNAAMMEE + mmlloocckk, mmuunnlloocckk - lock (unlock) physical pages in memory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + mmlloocckk(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n); + + _i_n_t + mmuunnlloocckk(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmlloocckk system call locks into memory the physical pages associated + with the virtual address range starting at _a_d_d_r for _l_e_n bytes. The + mmuunnlloocckk call unlocks pages previously locked by one or more mmlloocckk calls. + For both, the _a_d_d_r parameter should be aligned to a multiple of the page + size. If the _l_e_n parameter is not a multiple of the page size, it will + be rounded up to be so. The entire range must be allocated. + + After an mmlloocckk call, the indicated pages will cause neither a non- + resident page or address-translation fault until they are unlocked. They + may still cause protection-violation faults or TLB-miss faults on archi- + tectures with software-managed TLBs. The physical pages remain in memory + until all locked mappings for the pages are removed. Multiple processes + may have the same physical pages locked via their own virtual address + mappings. A single process may likewise have pages multiply-locked via + different virtual mappings of the same pages or via nested mmlloocckk calls on + the same address range. Unlocking is performed explicitly by mmuunnlloocckk or + implicitly by a call to mmuunnmmaapp which deallocates the unmapped address + range. Locked mappings are not inherited by the child process after a + fork(2). + + Since physical memory is a potentially scarce resource, processes are + limited in how much they can lock down. A single process can mmlloocckk the + minimum of a system-wide ``wired pages'' limit and the per-process + RLIMIT_MEMLOCK resource limit. + +RREETTUURRNN VVAALLUUEESS + A return value of 0 indicates that the call succeeded and all pages in + the range have either been locked or unlocked. A return value of -1 in- + dicates an error occurred and the locked status of all pages in the range + remains unchanged. In this case, the global location _e_r_r_n_o is set to in- + dicate the error. + +EERRRROORRSS + MMlloocckk() will fail if: + + [EINVAL] The address given is not page aligned or the length is neg- + ative. + + [EAGAIN] Locking the indicated range would exceed either the system + or per-process limit for locked memory. + + [ENOMEM] Some portion of the indicated address range is not allocat- + ed. There was an error faulting/mapping a page. + MMuunnlloocckk() will fail if: + + [EINVAL] The address given is not page aligned or the length is neg- + ative. + + [ENOMEM] Some portion of the indicated address range is not allocat- + ed. Some portion of the indicated address range is not + locked. + +SSEEEE AALLSSOO + fork(2), mmap(2), munmap(2), setrlimit(2), getpagesize(3) + +BBUUGGSS + Unlike The Sun implementation, multiple mmlloocckk calls on the same address + range require the corresponding number of mmuunnlloocckk calls to actually un- + lock the pages, i.e. mmlloocckk nests. This should be considered a conse- + quence of the implementation and not a feature. + + The per-process resource limit is a limit on the amount of virtual memory + locked, while the system-wide limit is for the number of locked physical + pages. Hence a process with two distinct locked mappings of the same + physical page counts as 2 pages against the per-process limit and as only + a single page in the system limit. + +HHIISSTTOORRYY + The mmlloocckk() and mmuunnlloocckk() functions first appeared in 4.4BSD. + +4.4BSD June 2, 1993 2 diff --git a/usr/share/man/cat2/mmap.0 b/usr/share/man/cat2/mmap.0 new file mode 100644 index 0000000000..9ccbdf2700 --- /dev/null +++ b/usr/share/man/cat2/mmap.0 @@ -0,0 +1,98 @@ +MMAP(2) BSD Programmer's Manual MMAP(2) + +NNAAMMEE + mmmmaapp - map files or devices into memory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _c_a_d_d_r___t + mmmmaapp(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n, _i_n_t _p_r_o_t, _i_n_t _f_l_a_g_s, _i_n_t _f_d, + _o_f_f___t _o_f_f_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + The mmmmaapp function causes the pages starting at _a_d_d_r and continuing for at + most _l_e_n bytes to be mapped from the object described by _f_d, starting at + byte offset _o_f_f_s_e_t. If _o_f_f_s_e_t or _l_e_n is not a multiple of the pagesize, + the mapped region may extend past the specified range. + + If _a_d_d_r is non-zero, it is used as a hint to the system. (As a conve- + nience to the system, the actual address of the region may differ from + the address supplied.) If _a_d_d_r is zero, an address will be selected by + the system. The actual starting address of the region is returned. A + successful _m_m_a_p deletes any previous mapping in the allocated address + range. + + The protections (region accessibility) are specified in the _p_r_o_t argument + by _o_r'ing the following values: + + PROT_EXEC Pages may be executed. + + PROT_READ Pages may be read. + + PROT_WRITE Pages may be written. + + The _f_l_a_g_s parameter specifies the type of the mapped object, mapping op- + tions and whether modifications made to the mapped copy of the page are + private to the process or are to be shared with other references. Shar- + ing, mapping type and options are specified in the _f_l_a_g_s argument by + _o_r'ing the following values: + + MAP_ANON Map anonymous memory not associated with any specific file. + The file descriptor used for creating MAP_ANON regions is + used only for naming, and may be specified as -1 if no name + is associated with the region. + + MAP_FIXED Do not permit the system to select a different address than + the one specified. If the specified address cannot be used, + mmmmaapp will fail. If MAP_FIXED is specified, _a_d_d_r must be a + multiple of the pagesize. Use of this option is discouraged. + + MAP_HASSEMAPHORE + Notify the kernel that the region may contain semaphores and + that special handling may be necessary. + + MAP_INHERIT + Permit regions to be inherited across exec(2) system calls. + + MAP_PRIVATE + Modifications are private. + + MAP_SHARED Modifications are shared. + + The close(2) function does not unmap pages, see munmap(2) for further in- + formation. + + The current design does not allow a process to specify the location of + swap space. In the future we may define an additional mapping type, + MAP_SWAP, in which the file descriptor argument specifies a file or de- + vice to which swapping should be done. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, mmmmaapp returns a pointer to the mapped region. + Otherwise, a value of -1 is returned and _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + MMmmaapp() will fail if: + + [EACCES] The flag PROT_READ was specified as part of the _p_r_o_t param- + eter and _f_d was not open for reading. The flags + PROT_WRITE, MAP_SHARED and MAP_WRITE were specified as part + of the _f_l_a_g_s and _p_r_o_t parameters and _f_d was not open for + writing. + + [EBADF] _F_d is not a valid open file descriptor. MAP_FIXED was + specified and the parameter was not page aligned. _F_d did + not reference a regular or character special file. + + [ENOMEM] MAP_FIXED was specified and the _a_d_d_r parameter wasn't + available. MAP_ANON was specified and insufficient memory + was available. + +SSEEEE AALLSSOO + getpagesize(2), msync(2), munmap(2), mprotect(2), madvise(2), min- + core(2) + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/mount.0 b/usr/share/man/cat2/mount.0 new file mode 100644 index 0000000000..aac3736939 --- /dev/null +++ b/usr/share/man/cat2/mount.0 @@ -0,0 +1,202 @@ +MOUNT(2) BSD Programmer's Manual MOUNT(2) + +NNAAMMEE + mmoouunntt, uunnmmoouunntt - mount or dismount a filesystem + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + mmoouunntt(_i_n_t _t_y_p_e, _c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s, _c_a_d_d_r___t _d_a_t_a); + + _i_n_t + uunnmmoouunntt(_c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The mmoouunntt() function grafts a filesystem object onto the system file tree + at the point _d_i_r. The argument _d_a_t_a describes the filesystem object to be + mounted. The argument _t_y_p_e tells the kernel how to interpret _d_a_t_a (See + _t_y_p_e below). The contents of the filesystem become available through the + new mount point _d_i_r. Any files in _d_i_r at the time of a successful mount + are swept under the carpet so to speak, and are unavailable until the + filesystem is unmounted. + + The following _f_l_a_g_s may be specified to suppress default semantics which + affect filesystem access. + + MNT_RDONLY The filesystem should be treated as read-only; Even the + super-user may not write on it. + + MNT_NOEXEC Do not allow files to be executed from the filesystem. + + MNT_NOSUID Do not honor setuid or setgid bits on files when execut- + ing them. + + MNT_NODEV Do not interpret special files on the filesystem. + + MNT_SYNCHRONOUS All I/O to the filesystem should be done synchronously. + + The flag MNT_UPDATE indicates that the mount command is being applied to + an already mounted filesystem. This allows the mount flags to be changed + without requiring that the filesystem be unmounted and remounted. Some + filesystems may not allow all flags to be changed. For example, most + filesystems will not allow a change from read-write to read-only. + + The _t_y_p_e argument defines the type of the filesystem. The types of + filesystems known to the system are defined in <_s_y_s_/_m_o_u_n_t_._h>. _D_a_t_a is a + pointer to a structure that contains the type specific arguments to + mount. The currently supported types of filesystems and their type spe- + cific data are: + + MOUNT_UFS + struct ufs_args { + char *fspec; /* Block special file to mount */ + int exflags; /* export related flags */ + uid_t exroot; /* mapping for root uid */ + }; + + MOUNT_NFS + struct nfs_args { + struct sockaddr_in *addr; /* file server address */ + nfsv2fh_t *fh; /* File handle to be mounted */ + int flags; /* flags */ + int wsize; /* write size in bytes */ + int rsize; /* read size in bytes */ + int timeo; /* initial timeout 0.1 secs */ + int retrans; /* times to retry send */ + char *hostname; /* server's name */ + }; + + MOUNT_MFS + struct mfs_args { + char *name; /* name of backing process */ + caddr_t base; /* base address of the filesystem */ + u_long size; /* size of the filesystem */ + }; + + The uummoouunntt() function call disassociates the filesystem from the speci- + fied mount point _d_i_r. + + The _f_l_a_g_s argument may specify MNT_FORCE to specify that the filesystem + should be forcibly unmounted even if files are still active. Active spe- + cial devices continue to work, but any further accesses to any other ac- + tive files result in errors even if the filesystem is later remounted. + +RREETTUURRNN VVAALLUUEESS + The mmoouunntt() returns the value 0 if the mount was successful, otherwise -1 + is returned and the variable _e_r_r_n_o is set to indicate the error. + + UUmmoouunntt returns the value 0 if the umount succeeded; otherwise -1 is re- + turned and the variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + MMoouunntt() will fail when one of the following occurs: + + [EPERM] The caller is not the super-user. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or the en- + tire length of a path name exceeded 1023 characters. + + [ELOOP] Too many symbolic links were encountered in translating a + pathname. + + [ENOENT] A component of _d_i_r does not exist. + + [ENOTDIR] A component of _n_a_m_e is not a directory, or a path prefix of + _s_p_e_c_i_a_l is not a directory. + + [EINVAL] A pathname contains a character with the high-order bit set. + + [EBUSY] Another process currently holds a reference to _d_i_r. + + [EFAULT] _D_i_r points outside the process's allocated address space. + + The following errors can occur for a _u_f_s filesystem mount: + + [ENODEV] A component of ufs_args _f_s_p_e_c does not exist. + + [ENOTBLK] _F_s_p_e_c is not a block device. + + [ENXIO] The major device number of _f_s_p_e_c is out of range (this indi- + cates no device driver exists for the associated hardware). + + [EBUSY] _F_s_p_e_c is already mounted. + + [EMFILE] No space remains in the mount table. + + [EINVAL] The super block for the filesystem had a bad magic number or + + + an out of range block size. + + [ENOMEM] Not enough memory was available to read the cylinder group in- + formation for the filesystem. + + [EIO] An I/O error occurred while reading the super block or cylin- + der group information. + + [EFAULT] _F_s_p_e_c points outside the process's allocated address space. + + The following errors can occur for a _n_f_s filesystem mount: + + [ETIMEDOUT] + _N_f_s timed out trying to contact the server. + + [EFAULT] Some part of the information described by nfs_args points out- + side the process's allocated address space. + + The following errors can occur for a _m_f_s filesystem mount: + + [EMFILE] No space remains in the mount table. + + [EINVAL] The super block for the filesystem had a bad magic number or + an out of range block size. + + [ENOMEM] Not enough memory was available to read the cylinder group in- + formation for the filesystem. + + [EIO] An paging error occurred while reading the super block or + cylinder group information. + + [EFAULT] _N_a_m_e points outside the process's allocated address space. + + UUmmoouunntt may fail with one of the following errors: + + [EPERM] The caller is not the super-user. + + [ENOTDIR] A component of the path is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EINVAL] The requested directory is not in the mount table. + + [EBUSY] A process is holding a reference to a file located on the + filesystem. + + [EIO] An I/O error occurred while writing cached filesystem informa- + tion. + + [EFAULT] _D_i_r points outside the process's allocated address space. + + A _u_f_s or _m_f_s mount can also fail if the maximum number of filesystems are + currently mounted. + +SSEEEE AALLSSOO + mount(8), umount(8), mfs(8) + +BBUUGGSS + Some of the error codes need translation to more obvious messages. + +HHIISSTTOORRYY + MMoouunntt() and uummoouunntt() function calls appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution July 11, 1993 4 diff --git a/usr/share/man/cat2/mprotect.0 b/usr/share/man/cat2/mprotect.0 new file mode 100644 index 0000000000..36907b2df0 --- /dev/null +++ b/usr/share/man/cat2/mprotect.0 @@ -0,0 +1,21 @@ +MPROTECT(2) BSD Programmer's Manual MPROTECT(2) + +NNAAMMEE + mmpprrootteecctt - control the protection of pages + +SSYYNNOOPPSSIISS + mmpprrootteecctt(_c_a_d_d_r___t _a_d_d_r, _i_n_t _l_e_n, _i_n_t _p_r_o_t); + +DDEESSCCRRIIPPTTIIOONN + The mmpprrootteecctt() system call changes the specified pages to have protection + _p_r_o_t. Not all implementations will guarantee protection on a page basis; + the granularity of protection changes may be as large as an entire re- + gion. + +SSEEEE AALLSSOO + msync(2), munmap(2), madvise(2), mincore(2) + +HHIISSTTOORRYY + The mmpprrootteecctt() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/msync.0 b/usr/share/man/cat2/msync.0 new file mode 100644 index 0000000000..2acadd4f47 --- /dev/null +++ b/usr/share/man/cat2/msync.0 @@ -0,0 +1,24 @@ +MSYNC(2) BSD Programmer's Manual MSYNC(2) + +NNAAMMEE + mmssyynncc - synchronize a mapped region + +SSYYNNOOPPSSIISS + mmssyynncc(_c_a_d_d_r___t _a_d_d_r, _i_n_t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmssyynncc() system call writes any modified pages back to the filesystem + and updates the file modification time. If _l_e_n is 0, all modified pages + within the region containing _a_d_d_r will be flushed; if _l_e_n is non-zero, + only the pages containing _a_d_d_r and _l_e_n succeeding locations will be exam- + ined. Any required synchronization of memory caches will also take place + at this time. Filesystem operations on a file that is mapped for shared + modifications are unpredictable except after an mmssyynncc(). + +SSEEEE AALLSSOO + madvise(2), munmap(2), mprotect(2), mincore(2) + +HHIISSTTOORRYY + The mmssyynncc() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/munlock.0 b/usr/share/man/cat2/munlock.0 new file mode 100644 index 0000000000..2e37d9f31f --- /dev/null +++ b/usr/share/man/cat2/munlock.0 @@ -0,0 +1,87 @@ +MLOCK(2) BSD Programmer's Manual MLOCK(2) + +NNAAMMEE + mmlloocckk, mmuunnlloocckk - lock (unlock) physical pages in memory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + mmlloocckk(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n); + + _i_n_t + mmuunnlloocckk(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmlloocckk system call locks into memory the physical pages associated + with the virtual address range starting at _a_d_d_r for _l_e_n bytes. The + mmuunnlloocckk call unlocks pages previously locked by one or more mmlloocckk calls. + For both, the _a_d_d_r parameter should be aligned to a multiple of the page + size. If the _l_e_n parameter is not a multiple of the page size, it will + be rounded up to be so. The entire range must be allocated. + + After an mmlloocckk call, the indicated pages will cause neither a non- + resident page or address-translation fault until they are unlocked. They + may still cause protection-violation faults or TLB-miss faults on archi- + tectures with software-managed TLBs. The physical pages remain in memory + until all locked mappings for the pages are removed. Multiple processes + may have the same physical pages locked via their own virtual address + mappings. A single process may likewise have pages multiply-locked via + different virtual mappings of the same pages or via nested mmlloocckk calls on + the same address range. Unlocking is performed explicitly by mmuunnlloocckk or + implicitly by a call to mmuunnmmaapp which deallocates the unmapped address + range. Locked mappings are not inherited by the child process after a + fork(2). + + Since physical memory is a potentially scarce resource, processes are + limited in how much they can lock down. A single process can mmlloocckk the + minimum of a system-wide ``wired pages'' limit and the per-process + RLIMIT_MEMLOCK resource limit. + +RREETTUURRNN VVAALLUUEESS + A return value of 0 indicates that the call succeeded and all pages in + the range have either been locked or unlocked. A return value of -1 in- + dicates an error occurred and the locked status of all pages in the range + remains unchanged. In this case, the global location _e_r_r_n_o is set to in- + dicate the error. + +EERRRROORRSS + MMlloocckk() will fail if: + + [EINVAL] The address given is not page aligned or the length is neg- + ative. + + [EAGAIN] Locking the indicated range would exceed either the system + or per-process limit for locked memory. + + [ENOMEM] Some portion of the indicated address range is not allocat- + ed. There was an error faulting/mapping a page. + MMuunnlloocckk() will fail if: + + [EINVAL] The address given is not page aligned or the length is neg- + ative. + + [ENOMEM] Some portion of the indicated address range is not allocat- + ed. Some portion of the indicated address range is not + locked. + +SSEEEE AALLSSOO + fork(2), mmap(2), munmap(2), setrlimit(2), getpagesize(3) + +BBUUGGSS + Unlike The Sun implementation, multiple mmlloocckk calls on the same address + range require the corresponding number of mmuunnlloocckk calls to actually un- + lock the pages, i.e. mmlloocckk nests. This should be considered a conse- + quence of the implementation and not a feature. + + The per-process resource limit is a limit on the amount of virtual memory + locked, while the system-wide limit is for the number of locked physical + pages. Hence a process with two distinct locked mappings of the same + physical page counts as 2 pages against the per-process limit and as only + a single page in the system limit. + +HHIISSTTOORRYY + The mmlloocckk() and mmuunnlloocckk() functions first appeared in 4.4BSD. + +4.4BSD June 2, 1993 2 diff --git a/usr/share/man/cat2/munmap.0 b/usr/share/man/cat2/munmap.0 new file mode 100644 index 0000000000..bf9301f072 --- /dev/null +++ b/usr/share/man/cat2/munmap.0 @@ -0,0 +1,20 @@ +MUNMAP(2) BSD Programmer's Manual MUNMAP(2) + +NNAAMMEE + mmuunnmmaapp - remove a mapping + +SSYYNNOOPPSSIISS + mmuunnmmaapp(_c_a_d_d_r___t _a_d_d_r, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmuunnmmaapp() system call deletes the mappings for the specified address + range, and causes further references to addresses within the range to + generate invalid memory references. + +SSEEEE AALLSSOO + msync(2), madvise(2), mprotect(2), mincore(2) + +HHIISSTTOORRYY + The mmuunnmmaapp() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat2/nfssvc.0 b/usr/share/man/cat2/nfssvc.0 new file mode 100644 index 0000000000..44586e8b61 --- /dev/null +++ b/usr/share/man/cat2/nfssvc.0 @@ -0,0 +1,109 @@ +NFSSVC(2) BSD Programmer's Manual NFSSVC(2) + +NNAAMMEE + nnffssssvvcc - NFS services + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + nnffssssvvcc(_i_n_t _f_l_a_g_s, _v_o_i_d _*_a_r_g_s_t_r_u_c_t_p); + +DDEESSCCRRIIPPTTIIOONN + The nnffssssvvcc() function is used by the NFS daemons to pass information into + and out of the kernel and also to enter the kernel as a server daemon. + The _f_l_a_g_s argument consists of several bits that show what action is to + be taken once in the kernel and the _a_r_g_s_t_r_u_c_t_p points to one of three + structures depending on which bits are set in flags. + + On the client side, nfsiod(8) calls nnffssssvvcc() with the _f_l_a_g_s argument set + to NFSSVC_BIOD and _a_r_g_s_t_r_u_c_t_p set to NULL to enter the kernel as a block + I/O server daemon. For NNQQNNFFSS, mount_nfs(8) calls nnffssssvvcc() with the + NFSSVC_MNTD flag, optionally or'd with the flags NFSSVC_GOTAUTH and + NFSSVC_AUTHINFAIL along with a pointer to a + + struct nfsd_cargs { + char *ncd_dirp; /* Mount dir path */ + uid_t ncd_authuid; /* Effective uid */ + int ncd_authtype; /* Type of authenticator */ + int ncd_authlen; /* Length of authenticator string */ + char *ncd_authstr; /* Authenticator string */ + }; + + structure. The initial call has only the NFSSVC_MNTD flag set to specify + service for the mount point. If the mount point is using Kerberos, then + the mount_nfs(8) daemon will return from nnffssssvvcc() with errno == ENEEDAUTH + whenever the client side requires an ``rcmd'' authentication ticket for + the user. Mount_nfs(8) will attempt to get the Kerberos ticket, and if + successful will call nnffssssvvcc() with the flags NFSSVC_MNTD and + NFSSVC_GOTAUTH after filling the ticket into the ncd_authstr field and + setting the ncd_authlen and ncd_authtype fields of the nfsd_cargs struc- + ture. If mount_nfs(8) failed to get the ticket, nnffssssvvcc() will be called + with the flags NFSSVC_MNTD, NFSSVC_GOTAUTH and NFSSVC_AUTHINFAIL to de- + note a failed authentication attempt. + + On the server side, nnffssssvvcc() is called with the flag NFSSVC_NFSD and a + pointer to a + + struct nfsd_srvargs { + struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ + uid_t nsd_uid; /* Effective uid mapped to cred */ + u_long nsd_haddr; /* Ip address of client */ + struct ucred nsd_cr; /* Cred. uid maps to */ + int nsd_authlen; /* Length of auth string (ret) */ + char *nsd_authstr; /* Auth string (ret) */ + }; + + to enter the kernel as an nfsd(8) daemon. Whenever an nfsd(8) daemon re- + ceives a Kerberos authentication ticket, it will return from nnffssssvvcc() + with errno == ENEEDAUTH. The nfsd(8) will attempt to authenticate the + ticket and generate a set of credentials on the server for the ``user + id'' specified in the field nsd_uid. This is done by first authenticat- + ing the Kerberos ticket and then mapping the Kerberos principal to a lo- + cal name and getting a set of credentials for that user via. getpwnam(3) + and getgrouplist(3). If successful, the nfsd(8) will call nnffssssvvcc() with + the NFSSVC_NFSD and NFSSVC_AUTHIN flags set to pass the credential map- + ping in nsd_cr into the kernel to be cached on the server socket for that + client. If the authentication failed, nfsd(8) calls nnffssssvvcc() with the + flags NFSSVC_NFSD and NFSSVC_AUTHINFAIL to denote an authentication fail- + ure. + + The master nfsd(8) server daemon calls nnffssssvvcc() with the flag + NFSSVC_ADDSOCK and a pointer to a + + struct nfsd_args { + int sock; /* Socket to serve */ + caddr_t name; /* Client address for connection based sockets */ + int namelen; /* Length of name */ + }; + + to pass a server side NFS socket into the kernel for servicing by the + nfsd(8) daemons. + +RREETTUURRNN VVAALLUUEESS + Normally nnffssssvvcc does not return unless the server is terminated by a sig- + nal when a value of 0 is returned. Otherwise, -1 is returned and the + global variable _e_r_r_n_o is set to specify the error. + +EERRRROORRSS + [ENEEDAUTH] This special error value is really used for authentication + support, particularly Kerberos, as explained above. + + [EPERM] The caller is not the super-user. + +SSEEEE AALLSSOO + nfsd(8), mount_nfs(8), nfsiod(8) + +HHIISSTTOORRYY + The nnffssssvvcc function first appeared in 4.4BSD. + +BBUUGGSS + The nnffssssvvcc system call is designed specifically for the NFS support dae- + mons and as such is specific to their requirements. It should really re- + turn values to indicate the need for authentication support, since + ENEEDAUTH is not really an error. Several fields of the argument struc- + tures are assumed to be valid and sometimes to be unchanged from a previ- + ous call, such that nnffssssvvcc must be used with extreme care. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/open.0 b/usr/share/man/cat2/open.0 new file mode 100644 index 0000000000..b6b606bed1 --- /dev/null +++ b/usr/share/man/cat2/open.0 @@ -0,0 +1,152 @@ +OPEN(2) BSD Programmer's Manual OPEN(2) + +NNAAMMEE + ooppeenn - open or create a file for reading or writing + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _f_l_a_g_s, _m_o_d_e___t _m_o_d_e); + +DDEESSCCRRIIPPTTIIOONN + The file name specified by _p_a_t_h is opened for reading and/or writing as + specified by the argument _f_l_a_g_s and the file descriptor returned to the + calling process. The _f_l_a_g_s argument may indicate the file is to be cre- + ated if it does not exist (by specifying the O_CREAT flag), in which case + the file is created with mode _m_o_d_e as described in chmod(2) and modified + by the process' umask value (see umask(2)). + + The flags specified are formed by _o_r _A_p _i_n_g the following values + + O_RDONLY open for reading only + O_WRONLY open for writing only + O_RDWR open for reading and writing + O_NONBLOCK do not block on open + O_APPEND append on each write + O_CREAT create file if it does not exist + O_TRUNC truncate size to 0 + O_EXCL error if create and file exists + O_SHLOCK atomically obtain a shared lock + O_EXLOCK atomically obtain an exclusive lock + + Opening a file with O_APPEND set causes each write on the file to be ap- + pended to the end. If O_TRUNC is specified and the file exists, the file + is truncated to zero length. If O_EXCL is set with O_CREAT and the file + already exists, ooppeenn() returns an error. This may be used to implement a + simple exclusive access locking mechanism. If O_EXCL is set and the last + component of the pathname is a symbolic link, ooppeenn() will fail even if + the symbolic link points to a non-existent name. If the O_NONBLOCK flag + is specified and the ooppeenn() call would result in the process being + blocked for some reason (e.g., waiting for carrier on a dialup line), + ooppeenn() returns immediately. The first time the process attempts to per- + form I/O on the open file it will block (not currently implemented). + + When opening a file, a lock with flock(2) semantics can be obtained by + setting O_SHLOCK for a shared lock, or O_EXLOCK for an exclusive lock. + If creating a file with O_CREAT, the request for the lock will never fail + (provided that the underlying filesystem supports locking). + + If successful, ooppeenn() returns a non-negative integer, termed a file de- + scriptor. It returns -1 on failure. The file pointer used to mark the + current position within the file is set to the beginning of the file. + + When a new file is created it is given the group of the directory which + contains it. + + The new descriptor is set to remain open across execve system calls; see + close(2) and fcntl(2). + + The system imposes a limit on the number of file descriptors open simul- + taneously by one process. Getdtablesize(2) returns the current system + limit. + +EERRRROORRSS + + The named file is opened unless: + + [ENOTDIR] A component of the path prefix is not a directory. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] O_CREAT is not set and the named file does not exist. + + [ENOENT] A component of the path name that must exist does not ex- + ist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [EACCES] The required permissions (for reading and/or writing) are + denied for the given flags. + + [EACCES] O_CREAT is specified, the file does not exist, and the di- + rectory in which it is to be created does not permit writ- + ing. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EISDIR] The named file is a directory, and the arguments specify it + is to be opened for writing. + + [EROFS] The named file resides on a read-only file system, and the + file is to be modified. + + [EMFILE] The process has already reached its limit for open file de- + scriptors. + + [ENFILE] The system file table is full. + + [ENXIO] The named file is a character special or block special + file, and the device associated with this special file does + not exist. + + [EINTR] The ooppeenn operation was interrupted by a signal. + + [EOPNOTSUPP] O_SHLOCK or O_EXLOCK is specified but the underlying + filesystem does not support locking. + + [ENOSPC] O_CREAT is specified, the file does not exist, and the di- + rectory in which the entry for the new file is being placed + cannot be extended because there is no space left on the + file system containing the directory. + + [ENOSPC] O_CREAT is specified, the file does not exist, and there + are no free inodes on the file system on which the file is + being created. + + [EDQUOT] O_CREAT is specified, the file does not exist, and the di- + rectory in which the entry for the new file is being placed + cannot be extended because the user's quota of disk blocks + on the file system containing the directory has been ex- + hausted. + + [EDQUOT] O_CREAT is specified, the file does not exist, and the us- + er's quota of inodes on the file system on which the file + is being created has been exhausted. + + [EIO] An I/O error occurred while making the directory entry or + + allocating the inode for O_CREAT. + + [ETXTBSY] The file is a pure procedure (shared text) file that is be- + ing executed and the ooppeenn() call requests write access. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EEXIST] O_CREAT and O_EXCL were specified and the file exists. + + [EOPNOTSUPP] An attempt was made to open a socket (not currently imple- + mented). + +SSEEEE AALLSSOO + chmod(2), close(2), dup(2), getdtablesize(2), lseek(2), read(2), + write(2), umask(2) + +HHIISSTTOORRYY + An ooppeenn function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/pathconf.0 b/usr/share/man/cat2/pathconf.0 new file mode 100644 index 0000000000..a6b5e3bda2 --- /dev/null +++ b/usr/share/man/cat2/pathconf.0 @@ -0,0 +1,104 @@ +PATHCONF(2) BSD Programmer's Manual PATHCONF(2) + +NNAAMMEE + ppaatthhccoonnff, ffppaatthhccoonnff - get configurable pathname variables + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + ppaatthhccoonnff(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _n_a_m_e); + + _l_o_n_g + ffppaatthhccoonnff(_i_n_t _f_d, _i_n_t _n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + The ppaatthhccoonnff() and ffppaatthhccoonnff() functions provides a method for applica- + tions to determine the current value of a configurable system limit or + option variable associated with a pathname or file descriptor. + + For ppaatthhccoonnff, the _p_a_t_h argument is the name of a file or directory. For + ffppaatthhccoonnff, the _f_d argument is an open file descriptor. The _n_a_m_e argument + specifies the system variable to be queried. Symbolic constants for each + name value are found in the include file . + + The available values are as follows: + + _PC_LINK_MAX + The maximum file link count. + + _PC_MAX_CANON + The maximum number of bytes in terminal canonical input line. + + _PC_MAX_INPUT + The minimum maximum number of bytes for which space is available + in a terminal input queue. + + _PC_NAME_MAX + The maximum number of bytes in a file name. + + _PC_PATH_MAX + The maximum number of bytes in a pathname. + + _PC_PIPE_BUF + The maximum number of bytes which will be written atomically to a + pipe. + + _PC_CHOWN_RESTRICTED + Return 1 if appropriate privileges are required for the chown(2) + system call, otherwise 0. + + _PC_NO_TRUNC + Return 1 if file names longer than KERN_NAME_MAX are truncated. + + _PC_VDISABLE + Returns the terminal character disabling value. + +RREETTUURRNN VVAALLUUEESS + If the call to ppaatthhccoonnff or ffppaatthhccoonnff is not successful, -1 is returned + and _e_r_r_n_o is set appropriately. Otherwise, if the variable is associated + with functionality that does not have a limit in the system, -1 is re- + turned and _e_r_r_n_o is not modified. Otherwise, the current variable value + is returned. + +EERRRROORRSS + If any of the following conditions occur, the ppaatthhccoonnff and ffppaatthhccoonnff + + functions shall return -1 and set _e_r_r_n_o to the corresponding value. + + [EINVAL] The value of the _n_a_m_e argument is invalid. + + [EINVAL] The implementation does not support an association of the + variable name with the associated file. + PPaatthhccoonnff() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + + FFppaatthhccoonnff() will fail if: + + [EBADF] _f_d is not a valid open file descriptor. + + [EIO] An I/O error occurred while reading from or writing to the file + system. + +SSEEEE AALLSSOO + sysctl(3) + +HHIISSTTOORRYY + The ppaatthhccoonnff and ffppaatthhccoonnff functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/pipe.0 b/usr/share/man/cat2/pipe.0 new file mode 100644 index 0000000000..2530f68f02 --- /dev/null +++ b/usr/share/man/cat2/pipe.0 @@ -0,0 +1,52 @@ +PIPE(2) BSD Programmer's Manual PIPE(2) + +NNAAMMEE + ppiippee - create descriptor pair for interprocess communication + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ppiippee(_i_n_t _*_f_i_l_d_e_s); + +DDEESSCCRRIIPPTTIIOONN + The ppiippee() function creates a _p_i_p_e, which is an object allowing unidirec- + tional data flow, and allocates a pair of file descriptors. The first + descriptor connects to the _r_e_a_d _e_n_d of the pipe, and the second connects + to the _w_r_i_t_e _e_n_d, so that data written to _f_i_l_d_e_s_[_1_] appears on (i.e., can + be read from) _f_i_l_d_e_s_[_0_]. This allows the output of one program to be sent + to another program: the source's standard output is set up to be the + write end of the pipe, and the sink's standard input is set up to be the + read end of the pipe. The pipe itself persists until all its associated + descriptors are closed. + + A pipe whose read or write end has been closed is considered _w_i_d_o_w_e_d. + Writing on such a pipe causes the writing process to receive a SIGPIPE + signal. Widowing a pipe is the only way to deliver end-of-file to a + reader: after the reader consumes any buffered data, reading a widowed + pipe returns a zero count. + + Pipes are really a special case of the socketpair(2) call and, in fact, + are implemented as such in the system. + +RREETTUURRNN VVAALLUUEESS + On successful creation of the pipe, zero is returned. Otherwise, a value + of -1 is returned and the variable _e_r_r_n_o set to indicate the error. + +EERRRROORRSS + The ppiippee() call will fail if: + + [EMFILE] Too many descriptors are active. + + [ENFILE] The system file table is full. + + [EFAULT] The _f_i_l_d_e_s buffer is in an invalid area of the process's ad- + dress space. + +SSEEEE AALLSSOO + sh(1), read(2), write(2), fork(2), socketpair(2) + +HHIISSTTOORRYY + A ppiippee function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/profil.0 b/usr/share/man/cat2/profil.0 new file mode 100644 index 0000000000..bae1382eaf --- /dev/null +++ b/usr/share/man/cat2/profil.0 @@ -0,0 +1,54 @@ +PROFIL(2) BSD Programmer's Manual PROFIL(2) + +NNAAMMEE + pprrooffiill - control process profiling + +SSYYNNOOPPSSIISS + _i_n_t + pprrooffiill(_c_h_a_r _*_s_a_m_p_l_e_s, _i_n_t _s_i_z_e, _i_n_t _o_f_f_s_e_t, _i_n_t _s_c_a_l_e); + +DDEESSCCRRIIPPTTIIOONN + The pprrooffiill() function enables or disables program counter profiling of + the current process. If profiling is enabled, then at every clock tick, + the kernel updates an appropriate count in the _s_a_m_p_l_e_s buffer. + + The buffer _s_a_m_p_l_e_s contains _s_i_z_e bytes and is divided into a series of + 16-bit bins. Each bin counts the number of times the program counter was + in a particular address range in the process when a clock tick occurred + while profiling was enabled. For a given program counter address, the + number of the corresponding bin is given by the relation: + + [(pc - offset) / 2] * scale / 65536 + + The _o_f_f_s_e_t parameter is the lowest address at which the kernel takes pro- + gram counter samples. The _s_c_a_l_e parameter ranges from 1 to 65536 and can + be used to change the span of the bins. A scale of 65536 maps each bin + to 2 bytes of address range; a scale of 32768 gives 4 bytes, 16384 gives + 8 bytes and so on. Intermediate values provide approximate intermediate + ranges. A _s_c_a_l_e value of 0 disables profiling. + +RREETTUURRNN VVAALLUUEESS + If the _s_c_a_l_e value is nonzero and the buffer _s_a_m_p_l_e_s contains an illegal + address, pprrooffiill() returns -1, profiling is terminated and _e_r_r_n_o is set + appropriately. Otherwise pprrooffiill() returns 0. + +FFIILLEESS + /usr/lib/gcrt0.o profiling C run-time startup file + gmon.out conventional name for profiling output file + +EERRRROORRSS + The following error may be reported: + + [EFAULT] The buffer _s_a_m_p_l_e_s contains an invalid address. + +SSEEEE AALLSSOO + gprof(1) + +BBUUGGSS + This routine should be named pprrooffiillee(). + + The _s_a_m_p_l_e_s argument should really be a vector of type _u_n_s_i_g_n_e_d _s_h_o_r_t. + + The format of the gmon.out file is undocumented. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/ptrace.0 b/usr/share/man/cat2/ptrace.0 new file mode 100644 index 0000000000..51672536fe --- /dev/null +++ b/usr/share/man/cat2/ptrace.0 @@ -0,0 +1,264 @@ + + + +PTRACE(2) BSD Programmer's Manual PTRACE(2) + + +NNAAMMEE + ptrace - process trace + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + ppttrraaccee((rreeqquueesstt,, ppiidd,, aaddddrr,, ddaattaa)) + iinntt rreeqquueesstt,, ppiidd,, **aaddddrr,, ddaattaa;; + +DDEESSCCRRIIPPTTIIOONN + _P_t_r_a_c_e provides a means by which a parent process may con- + trol the execution of a child process, and examine and + change its core image. Its primary use is for the imple- + mentation of breakpoint debugging. There are four argu- + ments whose interpretation depends on a _r_e_q_u_e_s_t argument. + Generally, _p_i_d is the process ID of the traced process, + which must be a child (no more distant descendant) of the + tracing process. A process being traced behaves normally + until it encounters some signal whether internally gener- + ated like "illegal instruction" or externally generated + like "interrupt". See _s_i_g_v_e_c(2) for the list. Then the + traced process enters a stopped state and its parent is + notified via _w_a_i_t(2). When the child is in the stopped + state, its core image can be examined and modified using + _p_t_r_a_c_e. If desired, another _p_t_r_a_c_e request can then cause + the child either to terminate or to continue, possibly + ignoring the signal. + + The value of the _r_e_q_u_e_s_t argument determines the precise + action of the call: + + PT_TRACE_ME + This request is the only one used by the child pro- + cess; it declares that the process is to be traced by + its parent. All the other arguments are ignored. + Peculiar results will ensue if the parent does not + expect to trace the child. + + PT_READ_I, PT_READ_D + The word in the child process's address space at _a_d_d_r + is returned. If I and D space are separated (e.g. + historically on a pdp-11), request PT_READ_I indicates + I space, PT_READ_D D space. _A_d_d_r must be even on some + machines. The child must be stopped. The input _d_a_t_a + is ignored. + + PT_READ_U + The word of the system's per-process data area corre- + sponding to _a_d_d_r is returned. _A_d_d_r must be even on + + + +4th Berkeley Distribution June 4, 1993 1 + + + + + + + + +PTRACE(2) BSD Programmer's Manual PTRACE(2) + + + some machines and less than 512. This space contains + the registers and other information about the process; + its layout corresponds to the _u_s_e_r structure in the + system. + + PT_WRITE_I, PT_WRITE_D + The given _d_a_t_a is written at the word in the process's + address space corresponding to _a_d_d_r_, which must be + even on some machines. No useful value is returned. + If I and D space are separated, request PT_WRITE_I + indicates I space, PT_WRITE_D D space. Attempts to + write in pure procedure fail if another process is + executing the same file. + + PT_WRITE_U + The process's system data is written, as it is read + with request PT_READ_U. Only a few locations can be + written in this way: the general registers, the float- + ing point status and registers, and certain bits of + the processor status word. + + PT_CONTINUE + The _d_a_t_a argument is taken as a signal number and the + child's execution continues at location _a_d_d_r as if it + had incurred that signal. Normally the signal number + will be either 0 to indicate that the signal that + caused the stop should be ignored, or that value + fetched out of the process's image indicating which + signal caused the stop. If _a_d_d_r is (int *)1 then exe- + cution continues from where it stopped. + + PT_KILL + The traced process terminates. + + PT_STEP + Execution continues as in request PT_CONTINUE; how- + ever, as soon as possible after execution of at least + one instruction, execution stops again. The signal + number from the stop is SIGTRAP. (On the VAX-11 the + T-bit is used and just one instruction is executed.) + This is part of the mechanism for implementing break- + points. + + PT_ATTACH + The process indicated by _p_i_d is re-parented to the + calling process and delivered a SIGSTOP signal. The + child process may then be traced by the parent, as in + PT_TRACE_ME. A process already being traced cannot be + attached to. + + If the calling process is not owned by root, it must + + + +4th Berkeley Distribution June 4, 1993 2 + + + + + + + + +PTRACE(2) BSD Programmer's Manual PTRACE(2) + + + have the same real user ID as the target process and + not have used set user or group priviledges. + + PT_DETACH + The process indicated by _p_i_d is detached from tracing + and continues its execution. The process, which must + be a traced child of the caller, is re-parented with + the parent it had before tracing began. The _d_a_t_a and + _a_d_d_r arguments behave as in PT_CONTINUE. + + As indicated, these calls (except for request PT_TRACE_ME) + can be used only when the subject process has stopped. + The _w_a_i_t call is used to determine when a process stops; + in such a case the "termination" status returned by _w_a_i_t + has the value 0177 to indicate stoppage rather than gen- + uine termination. + + To forestall possible fraud, _p_t_r_a_c_e inhibits the set-user- + id and set-group-id facilities on subsequent _e_x_e_c_v_e(2) + calls. If a traced process calls _e_x_e_c_v_e, it will stop + before executing the first instruction of the new image + showing signal SIGTRAP. + + On a VAX-11, "word" also means a 32-bit integer, but the + "even" restriction does not apply. + +RREETTUURRNN VVAALLUUEE + A 0 value is returned if the call succeeds. If the call + fails then a -1 is returned and the global variable _e_r_r_n_o + is set to indicate the error. + +EERRRROORRSS + [EIO] The request code is invalid. + + [ESRCH] The specified process does not exist. + + [EIO] The given signal number is invalid. + + [EIO] The specified address is out of bounds. + + [EPERM] The specified process cannot be traced. + +SSEEEE AALLSSOO + wait(2), sigvec(2), adb(1) + +BBUUGGSS + _P_t_r_a_c_e is unique and arcane; it should be replaced with a + special file that can be opened and read and written. The + control functions could then be implemented with _i_o_c_t_l(2) + calls on this file. This would be simpler to understand + and have much better performance. + + + +4th Berkeley Distribution June 4, 1993 3 + + + + + + + + +PTRACE(2) BSD Programmer's Manual PTRACE(2) + + + The request PT_TRACE_ME call should be able to specify + signals that are to be treated normally and not cause a + stop. In this way, for example, programs with simulated + floating point (which use "illegal instruction" signals at + a very high rate) could be efficiently debugged. + + The error indication, -1, is a legitimate function value; + _e_r_r_n_o_, (see _i_n_t_r_o(2)), can be used to disambiguate. + + It should be possible to stop a process on occurrence of a + system call; in this way a completely controlled environ- + ment could be provided. + + PT_STEP is not supported on all architectures. For exam- + ple, the SPARC architecture does not have a trace bit, + which complicates single instruction stepping. Debuggers + and the like can emulate PT_STEP by placing breakpoints at + all possible locations of the next instruction. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4th Berkeley Distribution June 4, 1993 4 + + + + + diff --git a/usr/share/man/cat2/quotactl.0 b/usr/share/man/cat2/quotactl.0 new file mode 100644 index 0000000000..6c32938473 --- /dev/null +++ b/usr/share/man/cat2/quotactl.0 @@ -0,0 +1,119 @@ +QUOTACTL(2) BSD Programmer's Manual QUOTACTL(2) + +NNAAMMEE + qquuoottaaccttll - manipulate filesystem quotas + +SSYYNNOOPPSSIISS + _#_i_n_c_l_u_d_e _<_u_f_s_/_q_u_o_t_a_._h_> _/_* _f_o_r _u_f_s _q_u_o_t_a_s _*_/ _i_n_t + qquuoottaaccttll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _i_n_t _c_m_d, _i_n_t _i_d, _c_h_a_r _*_a_d_d_r); + +DDEESSCCRRIIPPTTIIOONN + The qquuoottaaccttll() call enables, disables and manipulates filesystem quotas. + A quota control command given by _c_m_d operates on the given filename _p_a_t_h + for the given user _i_d. The address of an optional command specific data + structure, _a_d_d_r, may be given; its interpretation is discussed below with + each command. + + Currently quotas are supported only for the ``ufs'' filesystem. For + ``ufs'', a command is composed of a primary command (see below) and a + command type used to interpret the _i_d. Types are supported for interpre- + tation of user identifiers and group identifiers. The ``ufs'' specific + commands are: + + Q_QUOTAON Enable disk quotas for the filesystem specified by _p_a_t_h. The + command type specifies the type of the quotas being enabled. + The _a_d_d_r argument specifies a file from which to take the quo- + tas. The quota file must exist; it is normally created with + the quotacheck(8) program. The _i_d argument is unused. Only + the super-user may turn quotas on. + + Q_QUOTAOFF + Disable disk quotas for the filesystem specified by _p_a_t_h. The + command type specifies the type of the quotas being disabled. + The _a_d_d_r and _i_d arguments are unused. Only the super-user may + turn quotas off. + + Q_GETQUOTA + Get disk quota limits and current usage for the user or group + (as determined by the command type) with identifier _i_d. _A_d_d_r + is a pointer to a _s_t_r_u_c_t _d_q_b_l_k structure (defined in + <_u_f_s_/_q_u_o_t_a_._h>). + + Q_SETQUOTA + Set disk quota limits for the user or group (as determined by + the command type) with identifier _i_d. _A_d_d_r is a pointer to a + _s_t_r_u_c_t _d_q_b_l_k structure (defined in <_u_f_s_/_q_u_o_t_a_._h>). The usage + fields of the _d_q_b_l_k structure are ignored. This call is re- + stricted to the super-user. + + Q_SETUSE Set disk usage limits for the user or group (as determined by + the command type) with identifier _i_d. _A_d_d_r is a pointer to a + _s_t_r_u_c_t _d_q_b_l_k structure (defined in <_u_f_s_/_q_u_o_t_a_._h>). Only the + usage fields are used. This call is restricted to the super- + user. + + Q_SYNC Update the on-disk copy of quota usages. The command type + specifies which type of quotas are to be updated. The _i_d and + _a_d_d_r parameters are ignored. + +RREETTUURRNN VVAALLUUEESS + A successful call returns 0, otherwise the value -1 is returned and the + global variable _e_r_r_n_o indicates the reason for the failure. + +EERRRROORRSS + + + A qquuoottaaccttll() call will fail if: + + [EOPNOTSUPP] The kernel has not been compiled with the QUOTA option. + + [EUSERS] The quota table cannot be expanded. + + [EINVAL] _C_m_d or the command type is invalid. + + [EINVAL] A pathname contains a character with the high-order bit + set. + + [EACCES] In Q_QUOTAON, the quota file is not a plain file. + + [EACCES] Search permission is denied for a component of a path + prefix. + + [ENOTDIR] A component of a path prefix was not a directory. + + [ENAMETOOLONG] A component of either pathname exceeded 255 characters, + or the entire length of either path name exceeded 1023 + characters. + + [ENOENT] A filename does not exist. + + [ELOOP] Too many symbolic links were encountered in translating a + pathname. + + [EROFS] In Q_QUOTAON, the quota file resides on a read-only + filesystem. + + [EIO] An I/O error occurred while reading from or writing to a + file containing quotas. + + [EFAULT] An invalid _a_d_d_r was supplied; the associated structure + could not be copied in or out of the kernel. + + [EFAULT] _P_a_t_h points outside the process's allocated address + space. + + [EPERM] The call was privileged and the caller was not the super- + user. + +SSEEEE AALLSSOO + quota(1), fstab(5), edquota(8), quotacheck(8), quotaon(8), repquo- + ta(8) + +BBUUGGSS + There should be some way to integrate this call with the resource limit + interface provided by setrlimit(2) and getrlimit(2). + +HHIISSTTOORRYY + The qquuoottaaccttll function call appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat2/read.0 b/usr/share/man/cat2/read.0 new file mode 100644 index 0000000000..b853930cff --- /dev/null +++ b/usr/share/man/cat2/read.0 @@ -0,0 +1,94 @@ +READ(2) BSD Programmer's Manual READ(2) + +NNAAMMEE + rreeaadd, rreeaaddvv - read input + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_s_i_z_e___t + rreeaadd(_i_n_t _d, _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _i_n_t + rreeaaddvv(_i_n_t _d, _s_t_r_u_c_t _i_o_v_e_c _*_i_o_v, _i_n_t _i_o_v_c_n_t); + +DDEESSCCRRIIPPTTIIOONN + RReeaadd() attempts to read _n_b_y_t_e_s of data from the object referenced by the + descriptor _d into the buffer pointed to by _b_u_f. RReeaaddvv() performs the same + action, but scatters the input data into the _i_o_v_c_n_t buffers specified by + the members of the _i_o_v array: iov[0], iov[1], ..., iov[iovcnt-1]. + + For rreeaaddvv(), the _i_o_v_e_c structure is defined as + struct iovec { + void *iov_base; + int iov_len; + }; + + Each _i_o_v_e_c entry specifies the base address and length of an area in mem- + ory where data should be placed. RReeaaddvv() will always fill an area com- + pletely before proceeding to the next. + + On objects capable of seeking, the rreeaadd() starts at a position given by + the pointer associated with _d (see lseek(2)). Upon return from rreeaadd(), + the pointer is incremented by the number of bytes actually read. + + Objects that are not capable of seeking always read from the current po- + sition. The value of the pointer associated with such an object is unde- + fined. + + Upon successful completion, rreeaadd() and rreeaaddvv() return the number of bytes + actually read and placed in the buffer. The system guarantees to read + the number of bytes requested if the descriptor references a normal file + that has that many bytes left before the end-of-file, but in no other + case. + +RREETTUURRNN VVAALLUUEESS + If successful, the number of bytes actually read is returned. Upon read- + ing end-of-file, zero is returned. Otherwise, a -1 is returned and the + global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + RReeaadd() and rreeaaddvv() will succeed unless: + + [EBADF] _D is not a valid file or socket descriptor open for read- + ing. + + [EFAULT] _B_u_f points outside the allocated address space. + + [EIO] An I/O error occurred while reading from the file system. + + [EINTR] A read from a slow device was interrupted before any data + arrived by the delivery of a signal. + + + [EINVAL] The pointer associated with _d was negative. + + [EAGAIN] The file was marked for non-blocking I/O, and no data were + ready to be read. + + In addition, rreeaaddvv() may return one of the following errors: + + [EINVAL] _I_o_v_c_n_t was less than or equal to 0, or greater than 16. + + [EINVAL] One of the _i_o_v___l_e_n values in the _i_o_v array was negative. + + [EINVAL] The sum of the _i_o_v___l_e_n values in the _i_o_v array overflowed a + 32-bit integer. + + [EFAULT] Part of the _i_o_v points outside the process's allocated ad- + dress space. + +SSEEEE AALLSSOO + dup(2), fcntl(2), open(2), pipe(2), select(2), socket(2), socket- + pair(2) + +SSTTAANNDDAARRDDSS + RReeaadd() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The rreeaaddvv() function call appeared in 4.2BSD. A rreeaadd function call ap- + peared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/readlink.0 b/usr/share/man/cat2/readlink.0 new file mode 100644 index 0000000000..3803bb6366 --- /dev/null +++ b/usr/share/man/cat2/readlink.0 @@ -0,0 +1,54 @@ +READLINK(2) BSD Programmer's Manual READLINK(2) + +NNAAMMEE + rreeaaddlliinnkk - read value of a symbolic link + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rreeaaddlliinnkk(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_s_i_z); + +DDEESSCCRRIIPPTTIIOONN + RReeaaddlliinnkk() places the contents of the symbolic link _p_a_t_h in the buffer + _b_u_f, which has size _b_u_f_s_i_z. RReeaaddlliinnkk does not append a NUL character to + _b_u_f. + +RREETTUURRNN VVAALLUUEESS + The call returns the count of characters placed in the buffer if it suc- + ceeds, or a -1 if an error occurs, placing the error code in the global + variable _e_r_r_n_o. + +EERRRROORRSS + RReeaaddlliinnkk() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EINVAL] The named file is not a symbolic link. + + [EIO] An I/O error occurred while reading from the file system. + + [EFAULT] _B_u_f extends outside the process's allocated address space. + +SSEEEE AALLSSOO + stat(2), lstat(2), symlink(2) symlink(7), + +HHIISSTTOORRYY + The rreeaaddlliinnkk function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/readv.0 b/usr/share/man/cat2/readv.0 new file mode 100644 index 0000000000..b853930cff --- /dev/null +++ b/usr/share/man/cat2/readv.0 @@ -0,0 +1,94 @@ +READ(2) BSD Programmer's Manual READ(2) + +NNAAMMEE + rreeaadd, rreeaaddvv - read input + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_s_i_z_e___t + rreeaadd(_i_n_t _d, _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _i_n_t + rreeaaddvv(_i_n_t _d, _s_t_r_u_c_t _i_o_v_e_c _*_i_o_v, _i_n_t _i_o_v_c_n_t); + +DDEESSCCRRIIPPTTIIOONN + RReeaadd() attempts to read _n_b_y_t_e_s of data from the object referenced by the + descriptor _d into the buffer pointed to by _b_u_f. RReeaaddvv() performs the same + action, but scatters the input data into the _i_o_v_c_n_t buffers specified by + the members of the _i_o_v array: iov[0], iov[1], ..., iov[iovcnt-1]. + + For rreeaaddvv(), the _i_o_v_e_c structure is defined as + struct iovec { + void *iov_base; + int iov_len; + }; + + Each _i_o_v_e_c entry specifies the base address and length of an area in mem- + ory where data should be placed. RReeaaddvv() will always fill an area com- + pletely before proceeding to the next. + + On objects capable of seeking, the rreeaadd() starts at a position given by + the pointer associated with _d (see lseek(2)). Upon return from rreeaadd(), + the pointer is incremented by the number of bytes actually read. + + Objects that are not capable of seeking always read from the current po- + sition. The value of the pointer associated with such an object is unde- + fined. + + Upon successful completion, rreeaadd() and rreeaaddvv() return the number of bytes + actually read and placed in the buffer. The system guarantees to read + the number of bytes requested if the descriptor references a normal file + that has that many bytes left before the end-of-file, but in no other + case. + +RREETTUURRNN VVAALLUUEESS + If successful, the number of bytes actually read is returned. Upon read- + ing end-of-file, zero is returned. Otherwise, a -1 is returned and the + global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + RReeaadd() and rreeaaddvv() will succeed unless: + + [EBADF] _D is not a valid file or socket descriptor open for read- + ing. + + [EFAULT] _B_u_f points outside the allocated address space. + + [EIO] An I/O error occurred while reading from the file system. + + [EINTR] A read from a slow device was interrupted before any data + arrived by the delivery of a signal. + + + [EINVAL] The pointer associated with _d was negative. + + [EAGAIN] The file was marked for non-blocking I/O, and no data were + ready to be read. + + In addition, rreeaaddvv() may return one of the following errors: + + [EINVAL] _I_o_v_c_n_t was less than or equal to 0, or greater than 16. + + [EINVAL] One of the _i_o_v___l_e_n values in the _i_o_v array was negative. + + [EINVAL] The sum of the _i_o_v___l_e_n values in the _i_o_v array overflowed a + 32-bit integer. + + [EFAULT] Part of the _i_o_v points outside the process's allocated ad- + dress space. + +SSEEEE AALLSSOO + dup(2), fcntl(2), open(2), pipe(2), select(2), socket(2), socket- + pair(2) + +SSTTAANNDDAARRDDSS + RReeaadd() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The rreeaaddvv() function call appeared in 4.2BSD. A rreeaadd function call ap- + peared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/reboot.0 b/usr/share/man/cat2/reboot.0 new file mode 100644 index 0000000000..b7f32db2e3 --- /dev/null +++ b/usr/share/man/cat2/reboot.0 @@ -0,0 +1,90 @@ +REBOOT(2) BSD Programmer's Manual REBOOT(2) + +NNAAMMEE + rreebboooott - reboot system or halt processor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + rreebboooott(_i_n_t _h_o_w_t_o); + +DDEESSCCRRIIPPTTIIOONN + RReebboooott() reboots the system. Only the super-user may reboot a machine on + demand. However, a reboot is invoked automatically in the event of unre- + coverable system failures. + + _H_o_w_t_o is a mask of options; the system call interface allows the follow- + ing options, defined in the include file <_s_y_s_/_r_e_b_o_o_t_._h>, to be passed to + the new kernel or the new bootstrap and init programs. + + RB_AUTOBOOT The default, causing the system to reboot in its usual + fashion. + + RB_ASKNAME Interpreted by the bootstrap program itself, causing it to + prompt on the console as to what file should be booted. + Normally, the system is booted from the file + ``_x_x(0,0)vmunix'', where _x_x is the default disk name, with- + out prompting for the file name. + + RB_DFLTROOT Use the compiled in root device. Normally, the system uses + the device from which it was booted as the root device if + possible. (The default behavior is dependent on the abili- + ty of the bootstrap program to determine the drive from + which it was loaded, which is not possible on all systems.) + + RB_DUMP Dump kernel memory before rebooting; see savecore(8) for + more information. + + RB_HALT the processor is simply halted; no reboot takes place. + This option should be used with caution. + + RB_INITNAME An option allowing the specification of an init program + (see init(8)) other than _/_s_b_i_n_/_i_n_i_t to be run when the + system reboots. This switch is not currently available. + + RB_KDB Load the symbol table and enable a built-in debugger in the + system. This option will have no useful function if the + kernel is not configured for debugging. Several other op- + tions have different meaning if combined with this option, + although their use may not be possible via the rreebboooott() + call. See kadb(4) for more information. + + RB_NOSYNC Normally, the disks are sync'd (see sync(8)) before the + processor is halted or rebooted. This option may be useful + if file system changes have been made manually or if the + processor is on fire. + + RB_RDONLY Initially mount the root file system read-only. This is + currently the default, and this option has been deprecated. + + RB_SINGLE Normally, the reboot procedure involves an automatic disk + consistency check and then multi-user operations. + RB_SINGLE prevents this, booting the system with a single- + user shell on the console. RB_SINGLE is actually inter- + preted by the init(8) program in the newly booted system. + + When no options are given (i.e., RB_AUTOBOOT is used), the + system is rebooted from file ``vmunix'' in the root file + system of unit 0 of a disk chosen in a processor specific + way. An automatic consistency check of the disks is nor- + mally performed (see fsck(8)). + +RREETTUURRNN VVAALLUUEESS + If successful, this call never returns. Otherwise, a -1 is returned and + an error is returned in the global variable _e_r_r_n_o. + +EERRRROORRSS + [EPERM] The caller is not the super-user. + +SSEEEE AALLSSOO + kadb(4), crash(8), halt(8), init(8), reboot(8), savecore(8) + +BBUUGGSS + The HP300 implementation supports neither RB_DFLTROOT nor RB_KDB. + +HHIISSTTOORRYY + The rreebboooott function call appeared in 4.0BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/recv.0 b/usr/share/man/cat2/recv.0 new file mode 100644 index 0000000000..5d0d2cc380 --- /dev/null +++ b/usr/share/man/cat2/recv.0 @@ -0,0 +1,146 @@ +RECV(2) BSD Programmer's Manual RECV(2) + +NNAAMMEE + rreeccvv, rreeccvvffrroomm, rreeccvvmmssgg - receive a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + rreeccvv(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + rreeccvvffrroomm(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_f_r_o_m, + _i_n_t _*_f_r_o_m_l_e_n); + + _i_n_t + rreeccvvmmssgg(_i_n_t _s, _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + RReeccvvffrroomm() and rreeccvvmmssgg() 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. + + If _f_r_o_m is non-nil, and the socket is not connection-oriented, the source + address of the message is filled in. _F_r_o_m_l_e_n is a value-result parame- + ter, initialized to the size of the buffer associated with _f_r_o_m, and mod- + ified on return to indicate the actual size of the address stored there. + + The rreeccvv() call is normally used only on a _c_o_n_n_e_c_t_e_d socket (see + connect(2)) and is identical to rreeccvvffrroomm() with a nil _f_r_o_m parameter. + As it is redundant, it may not be supported in future releases. + + All three routines return the length of the message on successful comple- + tion. 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 re- + ceived from (see socket(2)). + + If no messages are available at the socket, the receive call waits for a + message to arrive, unless the socket is nonblocking (see fcntl(2)) in + which case the value -1 is returned and the external variable _e_r_r_n_o set + to EAGAIN. The receive calls normally return any data available, up to + the requested amount, rather than waiting for receipt of the full amount + requested; this behavior is affected by the socket-level options + SO_RCVLOWAT and SO_RCVTIMEO described in getsockopt(2). + + The select(2) call may be used to determine when more data arrive. + + The _f_l_a_g_s argument to a recv call is formed by _o_r _A_p _i_n_g one or more of + the values: + + MSG_OOB process out-of-band data + MSG_PEEK peek at incoming message + MSG_WAITALL wait for full request or error + The MSG_OOB 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. The MSG_PEEK 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. The MSG_WAITALL 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 re- + turned. + + The rreeccvvmmssgg() call uses a _m_s_g_h_d_r structure to minimize the number of di- + rectly supplied parameters. This structure has the following form, as + defined in <_s_y_s_/_s_o_c_k_e_t_._h>: + + struct msghdr { + caddr_t msg_name; /* optional address */ + u_int msg_namelen; /* size of address */ + struct iovec *msg_iov; /* scatter/gather array */ + u_int msg_iovlen; /* # elements in msg_iov */ + caddr_t msg_control; /* ancillary data, see below */ + u_int msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ + }; + + Here _m_s_g___n_a_m_e and _m_s_g___n_a_m_e_l_e_n specify the destination address if the + socket is unconnected; _m_s_g___n_a_m_e may be given as a null pointer if no + names are desired or required. _M_s_g___i_o_v and _m_s_g___i_o_v_l_e_n describe scatter + gather locations, as discussed in read(2). _M_s_g___c_o_n_t_r_o_l, which has length + _m_s_g___c_o_n_t_r_o_l_l_e_n, points to a buffer for other protocol control related + messages or other miscellaneous ancillary data. The messages are of the + form: + + struct cmsghdr { + u_int cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by + u_char cmsg_data[]; */ + }; + As an example, one could use this to learn of changes in the data-stream + in XNS/SPP, or in ISO, to obtain user-connection-request data by request- + ing a recvmsg with no data buffer provided immediately after an aacccceepptt() + call. + + Open file descriptors are now passed as ancillary data for AF_UNIX domain + sockets, with _c_m_s_g___l_e_v_e_l set to SOL_SOCKET and _c_m_s_g___t_y_p_e set to + SCM_RIGHTS. + + The _m_s_g___f_l_a_g_s field is set on return according to the message received. + MSG_EOR indicates end-of-record; the data returned completed a record + (generally used with sockets of type SOCK_SEQPACKET). MSG_TRUNC indicates + that the trailing portion of a datagram was discarded because the data- + gram was larger than the buffer supplied. MSG_CTRUNC indicates that some + control data were discarded due to lack of space in the buffer for ancil- + lary data. MSG_OOB is returned to indicate that expedited or out-of-band + data were received. + +RREETTUURRNN VVAALLUUEESS + These calls return the number of bytes received, or -1 if an error oc- + curred. + +EERRRROORRSS + The calls fail if: + + [EBADF] The argument _s is an invalid descriptor. + + [ENOTCONN] The socket is assoicated with a connection-oriented protocol + and has not been connected (see connect(2) and accept(2)). + + [ENOTSOCK] The argument _s does not refer to a socket. + + [EAGAIN] The socket is marked non-blocking, and the receive operation + would block, or a receive timeout had been set, and the time- + + + out expired before data were received. + + [EINTR] The receive was interrupted by delivery of a signal before + any data were available. + + [EFAULT] The receive buffer pointer(s) point outside the process's ad- + dress space. + +SSEEEE AALLSSOO + fcntl(2), read(2), select(2), getsockopt(2), socket(2) + +HHIISSTTOORRYY + The rreeccvv function call appeared in 4.2BSD. + +4.3-Reno Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/recvfrom.0 b/usr/share/man/cat2/recvfrom.0 new file mode 100644 index 0000000000..5d0d2cc380 --- /dev/null +++ b/usr/share/man/cat2/recvfrom.0 @@ -0,0 +1,146 @@ +RECV(2) BSD Programmer's Manual RECV(2) + +NNAAMMEE + rreeccvv, rreeccvvffrroomm, rreeccvvmmssgg - receive a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + rreeccvv(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + rreeccvvffrroomm(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_f_r_o_m, + _i_n_t _*_f_r_o_m_l_e_n); + + _i_n_t + rreeccvvmmssgg(_i_n_t _s, _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + RReeccvvffrroomm() and rreeccvvmmssgg() 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. + + If _f_r_o_m is non-nil, and the socket is not connection-oriented, the source + address of the message is filled in. _F_r_o_m_l_e_n is a value-result parame- + ter, initialized to the size of the buffer associated with _f_r_o_m, and mod- + ified on return to indicate the actual size of the address stored there. + + The rreeccvv() call is normally used only on a _c_o_n_n_e_c_t_e_d socket (see + connect(2)) and is identical to rreeccvvffrroomm() with a nil _f_r_o_m parameter. + As it is redundant, it may not be supported in future releases. + + All three routines return the length of the message on successful comple- + tion. 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 re- + ceived from (see socket(2)). + + If no messages are available at the socket, the receive call waits for a + message to arrive, unless the socket is nonblocking (see fcntl(2)) in + which case the value -1 is returned and the external variable _e_r_r_n_o set + to EAGAIN. The receive calls normally return any data available, up to + the requested amount, rather than waiting for receipt of the full amount + requested; this behavior is affected by the socket-level options + SO_RCVLOWAT and SO_RCVTIMEO described in getsockopt(2). + + The select(2) call may be used to determine when more data arrive. + + The _f_l_a_g_s argument to a recv call is formed by _o_r _A_p _i_n_g one or more of + the values: + + MSG_OOB process out-of-band data + MSG_PEEK peek at incoming message + MSG_WAITALL wait for full request or error + The MSG_OOB 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. The MSG_PEEK 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. The MSG_WAITALL 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 re- + turned. + + The rreeccvvmmssgg() call uses a _m_s_g_h_d_r structure to minimize the number of di- + rectly supplied parameters. This structure has the following form, as + defined in <_s_y_s_/_s_o_c_k_e_t_._h>: + + struct msghdr { + caddr_t msg_name; /* optional address */ + u_int msg_namelen; /* size of address */ + struct iovec *msg_iov; /* scatter/gather array */ + u_int msg_iovlen; /* # elements in msg_iov */ + caddr_t msg_control; /* ancillary data, see below */ + u_int msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ + }; + + Here _m_s_g___n_a_m_e and _m_s_g___n_a_m_e_l_e_n specify the destination address if the + socket is unconnected; _m_s_g___n_a_m_e may be given as a null pointer if no + names are desired or required. _M_s_g___i_o_v and _m_s_g___i_o_v_l_e_n describe scatter + gather locations, as discussed in read(2). _M_s_g___c_o_n_t_r_o_l, which has length + _m_s_g___c_o_n_t_r_o_l_l_e_n, points to a buffer for other protocol control related + messages or other miscellaneous ancillary data. The messages are of the + form: + + struct cmsghdr { + u_int cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by + u_char cmsg_data[]; */ + }; + As an example, one could use this to learn of changes in the data-stream + in XNS/SPP, or in ISO, to obtain user-connection-request data by request- + ing a recvmsg with no data buffer provided immediately after an aacccceepptt() + call. + + Open file descriptors are now passed as ancillary data for AF_UNIX domain + sockets, with _c_m_s_g___l_e_v_e_l set to SOL_SOCKET and _c_m_s_g___t_y_p_e set to + SCM_RIGHTS. + + The _m_s_g___f_l_a_g_s field is set on return according to the message received. + MSG_EOR indicates end-of-record; the data returned completed a record + (generally used with sockets of type SOCK_SEQPACKET). MSG_TRUNC indicates + that the trailing portion of a datagram was discarded because the data- + gram was larger than the buffer supplied. MSG_CTRUNC indicates that some + control data were discarded due to lack of space in the buffer for ancil- + lary data. MSG_OOB is returned to indicate that expedited or out-of-band + data were received. + +RREETTUURRNN VVAALLUUEESS + These calls return the number of bytes received, or -1 if an error oc- + curred. + +EERRRROORRSS + The calls fail if: + + [EBADF] The argument _s is an invalid descriptor. + + [ENOTCONN] The socket is assoicated with a connection-oriented protocol + and has not been connected (see connect(2) and accept(2)). + + [ENOTSOCK] The argument _s does not refer to a socket. + + [EAGAIN] The socket is marked non-blocking, and the receive operation + would block, or a receive timeout had been set, and the time- + + + out expired before data were received. + + [EINTR] The receive was interrupted by delivery of a signal before + any data were available. + + [EFAULT] The receive buffer pointer(s) point outside the process's ad- + dress space. + +SSEEEE AALLSSOO + fcntl(2), read(2), select(2), getsockopt(2), socket(2) + +HHIISSTTOORRYY + The rreeccvv function call appeared in 4.2BSD. + +4.3-Reno Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/recvmsg.0 b/usr/share/man/cat2/recvmsg.0 new file mode 100644 index 0000000000..5d0d2cc380 --- /dev/null +++ b/usr/share/man/cat2/recvmsg.0 @@ -0,0 +1,146 @@ +RECV(2) BSD Programmer's Manual RECV(2) + +NNAAMMEE + rreeccvv, rreeccvvffrroomm, rreeccvvmmssgg - receive a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + rreeccvv(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + rreeccvvffrroomm(_i_n_t _s, _v_o_i_d _*_b_u_f, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_f_r_o_m, + _i_n_t _*_f_r_o_m_l_e_n); + + _i_n_t + rreeccvvmmssgg(_i_n_t _s, _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + RReeccvvffrroomm() and rreeccvvmmssgg() 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. + + If _f_r_o_m is non-nil, and the socket is not connection-oriented, the source + address of the message is filled in. _F_r_o_m_l_e_n is a value-result parame- + ter, initialized to the size of the buffer associated with _f_r_o_m, and mod- + ified on return to indicate the actual size of the address stored there. + + The rreeccvv() call is normally used only on a _c_o_n_n_e_c_t_e_d socket (see + connect(2)) and is identical to rreeccvvffrroomm() with a nil _f_r_o_m parameter. + As it is redundant, it may not be supported in future releases. + + All three routines return the length of the message on successful comple- + tion. 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 re- + ceived from (see socket(2)). + + If no messages are available at the socket, the receive call waits for a + message to arrive, unless the socket is nonblocking (see fcntl(2)) in + which case the value -1 is returned and the external variable _e_r_r_n_o set + to EAGAIN. The receive calls normally return any data available, up to + the requested amount, rather than waiting for receipt of the full amount + requested; this behavior is affected by the socket-level options + SO_RCVLOWAT and SO_RCVTIMEO described in getsockopt(2). + + The select(2) call may be used to determine when more data arrive. + + The _f_l_a_g_s argument to a recv call is formed by _o_r _A_p _i_n_g one or more of + the values: + + MSG_OOB process out-of-band data + MSG_PEEK peek at incoming message + MSG_WAITALL wait for full request or error + The MSG_OOB 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. The MSG_PEEK 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. The MSG_WAITALL 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 re- + turned. + + The rreeccvvmmssgg() call uses a _m_s_g_h_d_r structure to minimize the number of di- + rectly supplied parameters. This structure has the following form, as + defined in <_s_y_s_/_s_o_c_k_e_t_._h>: + + struct msghdr { + caddr_t msg_name; /* optional address */ + u_int msg_namelen; /* size of address */ + struct iovec *msg_iov; /* scatter/gather array */ + u_int msg_iovlen; /* # elements in msg_iov */ + caddr_t msg_control; /* ancillary data, see below */ + u_int msg_controllen; /* ancillary data buffer len */ + int msg_flags; /* flags on received message */ + }; + + Here _m_s_g___n_a_m_e and _m_s_g___n_a_m_e_l_e_n specify the destination address if the + socket is unconnected; _m_s_g___n_a_m_e may be given as a null pointer if no + names are desired or required. _M_s_g___i_o_v and _m_s_g___i_o_v_l_e_n describe scatter + gather locations, as discussed in read(2). _M_s_g___c_o_n_t_r_o_l, which has length + _m_s_g___c_o_n_t_r_o_l_l_e_n, points to a buffer for other protocol control related + messages or other miscellaneous ancillary data. The messages are of the + form: + + struct cmsghdr { + u_int cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ + /* followed by + u_char cmsg_data[]; */ + }; + As an example, one could use this to learn of changes in the data-stream + in XNS/SPP, or in ISO, to obtain user-connection-request data by request- + ing a recvmsg with no data buffer provided immediately after an aacccceepptt() + call. + + Open file descriptors are now passed as ancillary data for AF_UNIX domain + sockets, with _c_m_s_g___l_e_v_e_l set to SOL_SOCKET and _c_m_s_g___t_y_p_e set to + SCM_RIGHTS. + + The _m_s_g___f_l_a_g_s field is set on return according to the message received. + MSG_EOR indicates end-of-record; the data returned completed a record + (generally used with sockets of type SOCK_SEQPACKET). MSG_TRUNC indicates + that the trailing portion of a datagram was discarded because the data- + gram was larger than the buffer supplied. MSG_CTRUNC indicates that some + control data were discarded due to lack of space in the buffer for ancil- + lary data. MSG_OOB is returned to indicate that expedited or out-of-band + data were received. + +RREETTUURRNN VVAALLUUEESS + These calls return the number of bytes received, or -1 if an error oc- + curred. + +EERRRROORRSS + The calls fail if: + + [EBADF] The argument _s is an invalid descriptor. + + [ENOTCONN] The socket is assoicated with a connection-oriented protocol + and has not been connected (see connect(2) and accept(2)). + + [ENOTSOCK] The argument _s does not refer to a socket. + + [EAGAIN] The socket is marked non-blocking, and the receive operation + would block, or a receive timeout had been set, and the time- + + + out expired before data were received. + + [EINTR] The receive was interrupted by delivery of a signal before + any data were available. + + [EFAULT] The receive buffer pointer(s) point outside the process's ad- + dress space. + +SSEEEE AALLSSOO + fcntl(2), read(2), select(2), getsockopt(2), socket(2) + +HHIISSTTOORRYY + The rreeccvv function call appeared in 4.2BSD. + +4.3-Reno Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/rename.0 b/usr/share/man/cat2/rename.0 new file mode 100644 index 0000000000..a1c6b6f8ba --- /dev/null +++ b/usr/share/man/cat2/rename.0 @@ -0,0 +1,110 @@ +RENAME(2) BSD Programmer's Manual RENAME(2) + +NNAAMMEE + rreennaammee - change the name of a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rreennaammee(_c_o_n_s_t _c_h_a_r _*_f_r_o_m, _c_o_n_s_t _c_h_a_r _*_t_o); + +DDEESSCCRRIIPPTTIIOONN + RReennaammee() causes the link named _f_r_o_m to be renamed as _t_o. If _t_o exists, it + is first removed. Both _f_r_o_m and _t_o must be of the same type (that is, + both directories or both non-directories), and must reside on the same + file system. + + RReennaammee() guarantees that an instance of _t_o will always exist, even if the + system should crash in the middle of the operation. + + If the final component of _f_r_o_m is a symbolic link, the symbolic link is + renamed, not the file or directory to which it points. + +CCAAVVEEAATT + The system can deadlock if a loop in the file system graph is present. + This loop takes the form of an entry in directory `_a', say `_a_/_f_o_o', being + a hard link to directory `_b', and an entry in directory `_b', say `_b_/_b_a_r', + being a hard link to directory `_a'. When such a loop exists and two sepa- + rate processes attempt to perform `rename a/foo b/bar' and `rename b/bar + a/foo', respectively, the system may deadlock attempting to lock both di- + rectories for modification. Hard links to directories should be replaced + by symbolic links by the system administrator. + +RREETTUURRNN VVAALLUUEESS + A 0 value is returned if the operation succeeds, otherwise rreennaammee() re- + turns -1 and the global variable _e_r_r_n_o indicates the reason for the fail- + ure. + +EERRRROORRSS + RReennaammee() will fail and neither of the argument files will be affected if: + + [EINVAL] Either pathname contains a character with the high-order + bit set. + + [ENAMETOOLONG] + A component of either pathname exceeded 255 characters, or + the entire length of either path name exceeded 1023 charac- + ters. + + [ENOENT] A component of the _f_r_o_m path does not exist, or a path pre- + fix of _t_o does not exist. + + [EACCES] A component of either path prefix denies search permission. + + [EACCES] The requested link requires writing in a directory with a + mode that denies write permission. + + [EPERM] The directory containing _f_r_o_m is marked sticky, and neither + the containing directory nor _f_r_o_m are owned by the effec- + tive user ID. + + [EPERM] The _t_o file exists, the directory containing _t_o is marked + sticky, and neither the containing directory nor _t_o are + + + owned by the effective user ID. + + [ELOOP] Too many symbolic links were encountered in translating ei- + ther pathname. + + [ENOTDIR] A component of either path prefix is not a directory. + + [ENOTDIR] _f_r_o_m is a directory, but _t_o is not a directory. + + [EISDIR] _t_o is a directory, but _f_r_o_m is not a directory. + + [EXDEV] The link named by _t_o and the file named by _f_r_o_m are on dif- + ferent logical devices (file systems). Note that this er- + ror code will not be returned if the implementation permits + cross-device links. + + [ENOSPC] The directory in which the entry for the new name is being + placed cannot be extended because there is no space left on + the file system containing the directory. + + [EDQUOT] The directory in which the entry for the new name is being + placed cannot be extended because the user's quota of disk + blocks on the file system containing the directory has been + exhausted. + + [EIO] An I/O error occurred while making or updating a directory + entry. + + [EROFS] The requested link requires writing in a directory on a + read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EINVAL] _F_r_o_m is a parent directory of _t_o, or an attempt is made to + rename `.' or `..'. + + [ENOTEMPTY] _T_o is a directory and is not empty. + +SSEEEE AALLSSOO + open(2) symlink(7) + +SSTTAANNDDAARRDDSS + RReennaammee() conforms to IEEE Std 1003.1-1988 (``POSIX''). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/revoke.0 b/usr/share/man/cat2/revoke.0 new file mode 100644 index 0000000000..3a3e61518f --- /dev/null +++ b/usr/share/man/cat2/revoke.0 @@ -0,0 +1,61 @@ +REVOKE(2) BSD Programmer's Manual REVOKE(2) + +NNAAMMEE + rreevvookkee - revoke file access + +SSYYNNOOPPSSIISS + _i_n_t + rreevvookkee(_c_h_a_r _*_p_a_t_h); + +DDEESSCCRRIIPPTTIIOONN + The rreevvookkee function invalidates all current open file descriptors in the + system for the file named by _p_a_t_h. Subsequent operations on any such de- + scriptors fail, with the exceptions that a rreeaadd() from a character device + file which has been revoked returns a count of zero (end of file), and a + cclloossee() call will succeed. If the file is a special file for a device + which is open, the device close function is called as if all open refer- + ences to the file had been closed. + + Access to a file may be revoked only by its owner or the super user. The + rreevvookkee function is currently supported only for block and character spe- + cial device files. It is normally used to prepare a terminal device for + a new login session, preventing any access by a previous user of the ter- + minal. + +RREETTUURRNN VVAALLUUEESS + A 0 value indicated that the call succeeded. A -1 return value indicates + an error occurred and _e_r_r_n_o is set to indicated the reason. + +EERRRROORRSS + Access to the named file is revoked unless one of the following: + + [ENOTDIR] A component of the path prefix is not a directory. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1024 characters. + + [ENOENT] The named file or a component of the path name does not ex- + ist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + [EINVAL] The named file is neither a character special or block spe- + cial file. + + [EPERM] The caller is neither the owner of the file nor the super + user. + +SSEEEE AALLSSOO + close(2) + +HHIISSTTOORRYY + The rreevvookkee function was introduced in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/rmdir.0 b/usr/share/man/cat2/rmdir.0 new file mode 100644 index 0000000000..66e9e7dc6a --- /dev/null +++ b/usr/share/man/cat2/rmdir.0 @@ -0,0 +1,66 @@ +RMDIR(2) BSD Programmer's Manual RMDIR(2) + +NNAAMMEE + rrmmddiirr - remove a directory file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rrmmddiirr(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); + +DDEESSCCRRIIPPTTIIOONN + RRmmddiirr() removes a directory file whose name is given by _p_a_t_h. The direc- + tory must not have any entries other than `.' and `..'. + +RREETTUURRNN VVAALLUUEESS + A 0 is returned if the remove succeeds; otherwise a -1 is returned and an + error code is stored in the global location _e_r_r_n_o. + +EERRRROORRSS + The named file is removed unless: + + [ENOTDIR] A component of the path is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named directory does not exist. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [ENOTEMPTY] The named directory contains files other than `.' and + `..' in it. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [EACCES] Write permission is denied on the directory containing + the link to be removed. + + [EPERM] The directory containing the directory to be removed is + marked sticky, and neither the containing directory nor + the directory to be removed are owned by the effective + user ID. + + [EBUSY] The directory to be removed is the mount point for a + mounted file system. + + [EIO] An I/O error occurred while deleting the directory entry + or deallocating the inode. + + [EROFS] The directory entry to be removed resides on a read-only + file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address + space. + +SSEEEE AALLSSOO + mkdir(2), unlink(2) + +HHIISSTTOORRYY + The rrmmddiirr function call appeared in 4.2BSD. diff --git a/usr/share/man/cat2/sbrk.0 b/usr/share/man/cat2/sbrk.0 new file mode 100644 index 0000000000..2c100de3ac --- /dev/null +++ b/usr/share/man/cat2/sbrk.0 @@ -0,0 +1,61 @@ +BRK(2) BSD Programmer's Manual BRK(2) + +NNAAMMEE + bbrrkk, ssbbrrkk - change data segment size + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r + **bbrrkk(_c_o_n_s_t _c_h_a_r _*_a_d_d_r); + + _c_h_a_r _* + **ssbbrrkk(_i_n_t _i_n_c_r); + +DDEESSCCRRIIPPTTIIOONN + TThhee bbrrkk aanndd ssbbrrkk ffuunnccttiioonnss aarree hhiissttoorriiccaall ccuurriioossiittiieess lleefftt oovveerr ffrroomm eeaarr-- + lliieerr ddaayyss bbeeffoorree tthhee aaddvveenntt ooff vviirrttuuaall mmeemmoorryy mmaannaaggeemmeenntt.. The bbrrkk() + function sets the break or lowest address of a process's data segment + (unilitialized data) to _a_d_d_r (immediately above bss). Data addressing is + restricted between _a_d_d_r and the lowest stack pointer to the stack seg- + ment. Memory is allocated by _b_r_k in page size pieces; if _a_d_d_r is not + evenly divisible by the system page size, it is increased to the next + page boundary. + + The current value of the program break is reliably returned by + ``sbrk(0)'' (see also end(3)). The getrlimit(2) system call may be used + to determine the maximum permissible size of the _d_a_t_a segment; it will + not be possible to set the break beyond the _r_l_i_m___m_a_x value returned from + a call to getrlimit, e.g. ``qetext + rlp->rlim_max.'' (see end(3) for + the definition of _e_t_e_x_t). + +RREETTUURRNN VVAALLUUEESS + BBrrkk returns a pointer to the new end of memory if successful; otherwise + -1 with _e_r_r_n_o set to indicate why the allocation failed. The ssbbrrkk re- + turns a pointer to the base of the new storage if successful; otherwise + -1 with _e_r_r_n_o set to indicate why the allocation failed. + +EERRRROORRSS + Sbrk will fail and no additional memory will be allocated if one of the + following are true: + + [ENOMEM] The limit, as set by setrlimit(2), was exceeded. + + [ENOMEM] The maximum possible size of a data segment (compiled into the + system) was exceeded. + + [ENOMEM] Insufficient space existed in the swap area to support the ex- + pansion. + +SSEEEE AALLSSOO + execve(2), getrlimit(2), malloc(3), end(3) + +BBUUGGSS + Setting the break may fail due to a temporary lack of swap space. It is + not possible to distinguish this from a failure caused by exceeding the + maximum size of the data segment without consulting getrlimit. + +HHIISSTTOORRYY + A bbrrkk function call appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/seek.0 b/usr/share/man/cat2/seek.0 new file mode 100644 index 0000000000..3b095d3fd2 --- /dev/null +++ b/usr/share/man/cat2/seek.0 @@ -0,0 +1,58 @@ +LSEEK(2) BSD Programmer's Manual LSEEK(2) + +NNAAMMEE + llsseeeekk - reposition read/write file offset + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _o_f_f___t + llsseeeekk(_i_n_t _f_i_l_d_e_s, _o_f_f___t _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + +DDEESSCCRRIIPPTTIIOONN + The llsseeeekk() function repositions the offset of the file descriptor _f_i_l_d_e_s + to the argument _o_f_f_s_e_t according to the directive _w_h_e_n_c_e_. The argument + _f_i_l_d_e_s must be an open file descriptor. LLsseeeekk() repositions the file + pointer _f_i_l_d_e_s as follows: + + If _w_h_e_n_c_e is SEEK_SET, the offset is set to _o_f_f_s_e_t bytes. + + If _w_h_e_n_c_e is SEEK_CUR, the offset is set to its current location + plus _o_f_f_s_e_t bytes. + + If _w_h_e_n_c_e is SEEK_END, the offset is set to the size of the file + plus _o_f_f_s_e_t bytes. + + The llsseeeekk() function allows the file offset to be set beyond the end of + the existing end-of-file of the file. If data is later written at this + point, subsequent reads of the data in the gap return bytes of zeros (un- + til data is actualy written into the gap). + + Some devices are incapable of seeking. The value of the pointer associ- + ated with such a device is undefined. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, llsseeeekk() returns the resulting offset location + as measured in bytes from the begining of the file. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + LLsseeeekk() will fail and the file pointer will remain unchanged if: + + [EBADF] _F_i_l_d_e_s is not an open file descriptor. + + [ESPIPE] _F_i_l_d_e_s is associated with a pipe, socket, or FIFO. + + [EINVAL] _W_h_e_n_c_e is not a proper value. + +SSEEEE AALLSSOO + dup(2), open(2) + +BBUUGGSS + This document's use of _w_h_e_n_c_e is incorrect English, but maintained for + historical reasons. + +SSTTAANNDDAARRDDSS + The llsseeeekk() function conforms to IEEE Std 1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/select.0 b/usr/share/man/cat2/select.0 new file mode 100644 index 0000000000..928bb7ff09 --- /dev/null +++ b/usr/share/man/cat2/select.0 @@ -0,0 +1,94 @@ +SELECT(2) BSD Programmer's Manual SELECT(2) + +NNAAMMEE + sseelleecctt - synchronous I/O multiplexing + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseelleecctt(_i_n_t _n_f_d_s, _f_d___s_e_t _*_r_e_a_d_f_d_s, _f_d___s_e_t _*_w_r_i_t_e_f_d_s, _f_d___s_e_t _*_e_x_c_e_p_t_f_d_s, + _s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_i_m_e_o_u_t); + + FFDD__SSEETT(_f_d, _&_f_d_s_e_t); + + FFDD__CCLLRR(_f_d, _&_f_d_s_e_t); + + FFDD__IISSSSEETT(_f_d, _&_f_d_s_e_t); + + FFDD__ZZEERROO(_&_f_d_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + SSeelleecctt() examines the I/O descriptor sets whose addresses are passed in + _r_e_a_d_f_d_s, _w_r_i_t_e_f_d_s, and _e_x_c_e_p_t_f_d_s to see if some of their descriptors are + ready for reading, are ready for writing, or have an exceptional condi- + tion pending, respectively. The first _n_f_d_s descriptors are checked in + each set; i.e., the descriptors from 0 through _n_f_d_s-1 in the descriptor + sets are examined. On return, sseelleecctt() replaces the given descriptor + sets with subsets consisting of those descriptors that are ready for the + requested operation. SSeelleecctt() returns the total number of ready descrip- + tors in all the sets. + + The descriptor sets are stored as bit fields in arrays of integers. The + following macros are provided for manipulating such descriptor sets: + FFDD__ZZEERROO(_&_f_d_s_e_t_x) initializes a descriptor set _f_d_s_e_t to the null set. + FFDD__SSEETT(_f_d, _&_f_d_s_e_t) includes a particular descriptor _f_d in _f_d_s_e_t. + FFDD__CCLLRR(_f_d, _&_f_d_s_e_t) removes _f_d from _f_d_s_e_t. FFDD__IISSSSEETT(_f_d, _&_f_d_s_e_t) is non- + zero if _f_d is a member of _f_d_s_e_t, zero otherwise. The behavior of these + macros is undefined if a descriptor value is less than zero or greater + than or equal to FD_SETSIZE, which is normally at least equal to the max- + imum number of descriptors supported by the system. + + If _t_i_m_e_o_u_t is a non-nil pointer, it specifies a maximum interval to wait + for the selection to complete. If _t_i_m_e_o_u_t is a nil pointer, the select + blocks indefinitely. To affect a poll, the _t_i_m_e_o_u_t argument should be + non-nil, pointing to a zero-valued timeval structure. + + Any of _r_e_a_d_f_d_s, _w_r_i_t_e_f_d_s, and _e_x_c_e_p_t_f_d_s may be given as nil pointers if + no descriptors are of interest. + +RREETTUURRNN VVAALLUUEESS + SSeelleecctt() returns the number of ready descriptors that are contained in + the descriptor sets, or -1 if an error occurred. If the time limit ex- + pires, sseelleecctt() returns 0. If sseelleecctt() returns with an error, including + one due to an interrupted call, the descriptor sets will be unmodified. + +EERRRROORRSS + An error return from sseelleecctt() indicates: + + [EBADF] One of the descriptor sets specified an invalid descriptor. + + [EINTR] A signal was delivered before the time limit expired and + + + before any of the selected events occurred. + + [EINVAL] The specified time limit is invalid. One of its components + is negative or too large. + +SSEEEE AALLSSOO + accept(2), connect(2), read(2), write(2), recv(2), send(2), getdta- + blesize(2) + +BBUUGGSS + Although the provision of getdtablesize(2) was intended to allow user + programs to be written independent of the kernel limit on the number of + open files, the dimension of a sufficiently large bit field for select + remains a problem. The default size FD_SETSIZE (currently 256) is some- + what larger than the current kernel limit to the number of open files. + However, in order to accommodate programs which might potentially use a + larger number of open files with select, it is possible to increase this + size within a program by providing a larger definition of FD_SETSIZE be- + fore the inclusion of <_s_y_s_/_t_y_p_e_s_._h>. + + SSeelleecctt() should probably return the time remaining from the original + timeout, if any, by modifying the time value in place. This may be im- + plemented in future versions of the system. Thus, it is unwise to assume + that the timeout value will be unmodified by the sseelleecctt() call. + +HHIISSTTOORRYY + The sseelleecctt function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/send.0 b/usr/share/man/cat2/send.0 new file mode 100644 index 0000000000..b7bc4f3b66 --- /dev/null +++ b/usr/share/man/cat2/send.0 @@ -0,0 +1,84 @@ +SEND(2) BSD Programmer's Manual SEND(2) + +NNAAMMEE + sseenndd, sseennddttoo, sseennddmmssgg - send a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseenndd(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + sseennddttoo(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, + _c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_t_o, _i_n_t _t_o_l_e_n); + + _i_n_t + sseennddmmssgg(_i_n_t _s, _c_o_n_s_t _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + SSeenndd(), sseennddttoo(), and sseennddmmssgg() are used to transmit a message to another + socket. SSeenndd() may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state, + while sseennddttoo() and sseennddmmssgg() may be used at any time. + + The address of the target is given by _t_o with _t_o_l_e_n specifying its size. + The length of the message is given by _l_e_n. If the message is too long to + pass atomically through the underlying protocol, the error EMSGSIZE is + returned, and the message is not transmitted. + + No indication of failure to deliver is implicit in a sseenndd(). Locally de- + tected errors are indicated by a return value of -1. + + If no messages space is available at the socket to hold the message to be + transmitted, then sseenndd() normally blocks, unless the socket has been + placed in non-blocking I/O mode. The select(2) call may be used to de- + termine when it is possible to send more data. + + The _f_l_a_g_s parameter may include one or more of the following: + + #define MSG_OOB 0x1 /* process out-of-band data */ + #define MSG_DONTROUTE 0x4 /* bypass routing, use direct interface */ + + The flag MSG_OOB is used to send ``out-of-band'' data on sockets that + support this notion (e.g. SOCK_STREAM); the underlying protocol must al- + so support ``out-of-band'' data. MSG_DONTROUTE is usually used only by + diagnostic or routing programs. + + See recv(2) for a description of the _m_s_g_h_d_r structure. + +RREETTUURRNN VVAALLUUEESS + The call returns the number of characters sent, or -1 if an error oc- + curred. + +EERRRROORRSS + SSeenndd(), sseennddttoo(), and sseennddmmssgg() fail if: + + [EBADF] An invalid descriptor was specified. + + [ENOTSOCK] The argument _s is not a socket. + + [EFAULT] An invalid user space address was specified for a parameter. + + [EMSGSIZE] The socket requires that message be sent atomically, and the + + + size of the message to be sent made this impossible. + + [EAGAIN] The socket is marked non-blocking and the requested operation + would block. + + [ENOBUFS] The system was unable to allocate an internal buffer. The + operation may succeed when buffers become available. + + [ENOBUFS] The output queue for a network interface was full. This gen- + erally indicates that the interface has stopped sending, but + may be caused by transient congestion. + +SSEEEE AALLSSOO + fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2) + +HHIISSTTOORRYY + The sseenndd function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/sendmsg.0 b/usr/share/man/cat2/sendmsg.0 new file mode 100644 index 0000000000..b7bc4f3b66 --- /dev/null +++ b/usr/share/man/cat2/sendmsg.0 @@ -0,0 +1,84 @@ +SEND(2) BSD Programmer's Manual SEND(2) + +NNAAMMEE + sseenndd, sseennddttoo, sseennddmmssgg - send a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseenndd(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + sseennddttoo(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, + _c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_t_o, _i_n_t _t_o_l_e_n); + + _i_n_t + sseennddmmssgg(_i_n_t _s, _c_o_n_s_t _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + SSeenndd(), sseennddttoo(), and sseennddmmssgg() are used to transmit a message to another + socket. SSeenndd() may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state, + while sseennddttoo() and sseennddmmssgg() may be used at any time. + + The address of the target is given by _t_o with _t_o_l_e_n specifying its size. + The length of the message is given by _l_e_n. If the message is too long to + pass atomically through the underlying protocol, the error EMSGSIZE is + returned, and the message is not transmitted. + + No indication of failure to deliver is implicit in a sseenndd(). Locally de- + tected errors are indicated by a return value of -1. + + If no messages space is available at the socket to hold the message to be + transmitted, then sseenndd() normally blocks, unless the socket has been + placed in non-blocking I/O mode. The select(2) call may be used to de- + termine when it is possible to send more data. + + The _f_l_a_g_s parameter may include one or more of the following: + + #define MSG_OOB 0x1 /* process out-of-band data */ + #define MSG_DONTROUTE 0x4 /* bypass routing, use direct interface */ + + The flag MSG_OOB is used to send ``out-of-band'' data on sockets that + support this notion (e.g. SOCK_STREAM); the underlying protocol must al- + so support ``out-of-band'' data. MSG_DONTROUTE is usually used only by + diagnostic or routing programs. + + See recv(2) for a description of the _m_s_g_h_d_r structure. + +RREETTUURRNN VVAALLUUEESS + The call returns the number of characters sent, or -1 if an error oc- + curred. + +EERRRROORRSS + SSeenndd(), sseennddttoo(), and sseennddmmssgg() fail if: + + [EBADF] An invalid descriptor was specified. + + [ENOTSOCK] The argument _s is not a socket. + + [EFAULT] An invalid user space address was specified for a parameter. + + [EMSGSIZE] The socket requires that message be sent atomically, and the + + + size of the message to be sent made this impossible. + + [EAGAIN] The socket is marked non-blocking and the requested operation + would block. + + [ENOBUFS] The system was unable to allocate an internal buffer. The + operation may succeed when buffers become available. + + [ENOBUFS] The output queue for a network interface was full. This gen- + erally indicates that the interface has stopped sending, but + may be caused by transient congestion. + +SSEEEE AALLSSOO + fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2) + +HHIISSTTOORRYY + The sseenndd function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/sendto.0 b/usr/share/man/cat2/sendto.0 new file mode 100644 index 0000000000..b7bc4f3b66 --- /dev/null +++ b/usr/share/man/cat2/sendto.0 @@ -0,0 +1,84 @@ +SEND(2) BSD Programmer's Manual SEND(2) + +NNAAMMEE + sseenndd, sseennddttoo, sseennddmmssgg - send a message from a socket + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseenndd(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s); + + _i_n_t + sseennddttoo(_i_n_t _s, _c_o_n_s_t _v_o_i_d _*_m_s_g, _i_n_t _l_e_n, _i_n_t _f_l_a_g_s, + _c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_t_o, _i_n_t _t_o_l_e_n); + + _i_n_t + sseennddmmssgg(_i_n_t _s, _c_o_n_s_t _s_t_r_u_c_t _m_s_g_h_d_r _*_m_s_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + SSeenndd(), sseennddttoo(), and sseennddmmssgg() are used to transmit a message to another + socket. SSeenndd() may be used only when the socket is in a _c_o_n_n_e_c_t_e_d state, + while sseennddttoo() and sseennddmmssgg() may be used at any time. + + The address of the target is given by _t_o with _t_o_l_e_n specifying its size. + The length of the message is given by _l_e_n. If the message is too long to + pass atomically through the underlying protocol, the error EMSGSIZE is + returned, and the message is not transmitted. + + No indication of failure to deliver is implicit in a sseenndd(). Locally de- + tected errors are indicated by a return value of -1. + + If no messages space is available at the socket to hold the message to be + transmitted, then sseenndd() normally blocks, unless the socket has been + placed in non-blocking I/O mode. The select(2) call may be used to de- + termine when it is possible to send more data. + + The _f_l_a_g_s parameter may include one or more of the following: + + #define MSG_OOB 0x1 /* process out-of-band data */ + #define MSG_DONTROUTE 0x4 /* bypass routing, use direct interface */ + + The flag MSG_OOB is used to send ``out-of-band'' data on sockets that + support this notion (e.g. SOCK_STREAM); the underlying protocol must al- + so support ``out-of-band'' data. MSG_DONTROUTE is usually used only by + diagnostic or routing programs. + + See recv(2) for a description of the _m_s_g_h_d_r structure. + +RREETTUURRNN VVAALLUUEESS + The call returns the number of characters sent, or -1 if an error oc- + curred. + +EERRRROORRSS + SSeenndd(), sseennddttoo(), and sseennddmmssgg() fail if: + + [EBADF] An invalid descriptor was specified. + + [ENOTSOCK] The argument _s is not a socket. + + [EFAULT] An invalid user space address was specified for a parameter. + + [EMSGSIZE] The socket requires that message be sent atomically, and the + + + size of the message to be sent made this impossible. + + [EAGAIN] The socket is marked non-blocking and the requested operation + would block. + + [ENOBUFS] The system was unable to allocate an internal buffer. The + operation may succeed when buffers become available. + + [ENOBUFS] The output queue for a network interface was full. This gen- + erally indicates that the interface has stopped sending, but + may be caused by transient congestion. + +SSEEEE AALLSSOO + fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2) + +HHIISSTTOORRYY + The sseenndd function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/setegid.0 b/usr/share/man/cat2/setegid.0 new file mode 100644 index 0000000000..21ebfbada1 --- /dev/null +++ b/usr/share/man/cat2/setegid.0 @@ -0,0 +1,57 @@ +SETUID(2) BSD Programmer's Manual SETUID(2) + +NNAAMMEE + sseettuuiidd, sseetteeuuiidd, sseettggiidd, sseetteeggiidd, - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseetteeuuiidd(_u_i_d___t _e_u_i_d); + + _i_n_t + sseettggiidd(_g_i_d___t _g_i_d); + + _i_n_t + sseetteeggiidd(_g_i_d___t _e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettuuiidd() function sets the real and effective user IDs and the saved + set-user-ID of the current process to the specified value. The sseettuuiidd() + function is permitted if the specified ID is equal to the real user ID of + the process, or if the effective user ID is that of the super user. + + The sseettggiidd() function sets the real and effective group IDs and the saved + set-group-ID of the current process to the specified value. The sseettggiidd() + function is permitted if the specified ID is equal to the real group ID + of the process, or if the effective user ID is that of the super user. + + The sseetteeuuiidd() function (sseetteeggiidd()) sets the effective user ID (group ID) + of the current process. The effective user ID may be set to the value of + the real user ID or the saved set-user-ID (see intro(2) and execve(2)); + in this way, the effective user ID of a set-user-ID executable may be + toggled by switching to the real user ID, then re-enabled by reverting to + the set-user-ID value. Similarly, the effective group ID may be set to + the value of the real group ID or the saved set-user-ID. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real, + effective ID, or saved ID, these functions return -1. + +SSEEEE AALLSSOO + getuid(2), getgid(2) + +SSTTAANNDDAARRDDSS + The sseettuuiidd() and sseettggiidd() functions are compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification with _POSIX_SAVED_IDS not de- + fined. The sseetteeuuiidd() and sseetteeggiidd() functions are extensions based on the + POSIX concept of _POSIX_SAVED_IDS, and have been proposed for a future + revision of the standard. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/seteuid.0 b/usr/share/man/cat2/seteuid.0 new file mode 100644 index 0000000000..21ebfbada1 --- /dev/null +++ b/usr/share/man/cat2/seteuid.0 @@ -0,0 +1,57 @@ +SETUID(2) BSD Programmer's Manual SETUID(2) + +NNAAMMEE + sseettuuiidd, sseetteeuuiidd, sseettggiidd, sseetteeggiidd, - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseetteeuuiidd(_u_i_d___t _e_u_i_d); + + _i_n_t + sseettggiidd(_g_i_d___t _g_i_d); + + _i_n_t + sseetteeggiidd(_g_i_d___t _e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettuuiidd() function sets the real and effective user IDs and the saved + set-user-ID of the current process to the specified value. The sseettuuiidd() + function is permitted if the specified ID is equal to the real user ID of + the process, or if the effective user ID is that of the super user. + + The sseettggiidd() function sets the real and effective group IDs and the saved + set-group-ID of the current process to the specified value. The sseettggiidd() + function is permitted if the specified ID is equal to the real group ID + of the process, or if the effective user ID is that of the super user. + + The sseetteeuuiidd() function (sseetteeggiidd()) sets the effective user ID (group ID) + of the current process. The effective user ID may be set to the value of + the real user ID or the saved set-user-ID (see intro(2) and execve(2)); + in this way, the effective user ID of a set-user-ID executable may be + toggled by switching to the real user ID, then re-enabled by reverting to + the set-user-ID value. Similarly, the effective group ID may be set to + the value of the real group ID or the saved set-user-ID. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real, + effective ID, or saved ID, these functions return -1. + +SSEEEE AALLSSOO + getuid(2), getgid(2) + +SSTTAANNDDAARRDDSS + The sseettuuiidd() and sseettggiidd() functions are compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification with _POSIX_SAVED_IDS not de- + fined. The sseetteeuuiidd() and sseetteeggiidd() functions are extensions based on the + POSIX concept of _POSIX_SAVED_IDS, and have been proposed for a future + revision of the standard. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/setgid.0 b/usr/share/man/cat2/setgid.0 new file mode 100644 index 0000000000..21ebfbada1 --- /dev/null +++ b/usr/share/man/cat2/setgid.0 @@ -0,0 +1,57 @@ +SETUID(2) BSD Programmer's Manual SETUID(2) + +NNAAMMEE + sseettuuiidd, sseetteeuuiidd, sseettggiidd, sseetteeggiidd, - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseetteeuuiidd(_u_i_d___t _e_u_i_d); + + _i_n_t + sseettggiidd(_g_i_d___t _g_i_d); + + _i_n_t + sseetteeggiidd(_g_i_d___t _e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettuuiidd() function sets the real and effective user IDs and the saved + set-user-ID of the current process to the specified value. The sseettuuiidd() + function is permitted if the specified ID is equal to the real user ID of + the process, or if the effective user ID is that of the super user. + + The sseettggiidd() function sets the real and effective group IDs and the saved + set-group-ID of the current process to the specified value. The sseettggiidd() + function is permitted if the specified ID is equal to the real group ID + of the process, or if the effective user ID is that of the super user. + + The sseetteeuuiidd() function (sseetteeggiidd()) sets the effective user ID (group ID) + of the current process. The effective user ID may be set to the value of + the real user ID or the saved set-user-ID (see intro(2) and execve(2)); + in this way, the effective user ID of a set-user-ID executable may be + toggled by switching to the real user ID, then re-enabled by reverting to + the set-user-ID value. Similarly, the effective group ID may be set to + the value of the real group ID or the saved set-user-ID. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real, + effective ID, or saved ID, these functions return -1. + +SSEEEE AALLSSOO + getuid(2), getgid(2) + +SSTTAANNDDAARRDDSS + The sseettuuiidd() and sseettggiidd() functions are compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification with _POSIX_SAVED_IDS not de- + fined. The sseetteeuuiidd() and sseetteeggiidd() functions are extensions based on the + POSIX concept of _POSIX_SAVED_IDS, and have been proposed for a future + revision of the standard. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/setgroups.0 b/usr/share/man/cat2/setgroups.0 new file mode 100644 index 0000000000..0bcfb83e94 --- /dev/null +++ b/usr/share/man/cat2/setgroups.0 @@ -0,0 +1,43 @@ +SETGROUPS(2) BSD Programmer's Manual SETGROUPS(2) + +NNAAMMEE + sseettggrroouuppss - set group access list + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettggrroouuppss(_i_n_t _n_g_r_o_u_p_s, _c_o_n_s_t _i_n_t _*_g_i_d_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + SSeettggrroouuppss() sets the group access list of the current user process ac- + cording to the array _g_i_d_s_e_t. The parameter _n_g_r_o_u_p_s indicates the number + of entries in the array and must be no more than NGROUPS, as defined in + <_s_y_s_/_p_a_r_a_m_._h>. + + Only the super-user may set new groups. + +RREETTUURRNN VVAALLUUEESS + A 0 value is returned on success, -1 on error, with an error code stored + in _e_r_r_n_o. + +EERRRROORRSS + The sseettggrroouuppss() call will fail if: + + [EPERM] The caller is not the super-user. + + [EFAULT] The address specified for _g_i_d_s_e_t is outside the process ad- + dress space. + +SSEEEE AALLSSOO + getgroups(2), initgroups(3) + +BBUUGGSS + The _g_i_d_s_e_t array should be of type _g_i_d___t, but remains integer for compat- + ibility with earlier systems. + +HHIISSTTOORRYY + The sseettggrroouuppss function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/sethostid.0 b/usr/share/man/cat2/sethostid.0 new file mode 100644 index 0000000000..985bd65170 --- /dev/null +++ b/usr/share/man/cat2/sethostid.0 @@ -0,0 +1,36 @@ +GETHOSTID(3) BSD Programmer's Manual GETHOSTID(3) + +NNAAMMEE + ggeetthhoossttiidd, sseetthhoossttiidd - get/set unique identifier of current host + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + ggeetthhoossttiidd(_v_o_i_d); + + _i_n_t + sseetthhoossttiidd(_l_o_n_g _h_o_s_t_i_d); + +DDEESSCCRRIIPPTTIIOONN + SSeetthhoossttiidd() establishes a 32-bit identifier for the current processor + that is intended to be unique among all UNIX systems in existence. This + is normally a DARPA Internet address for the local machine. This call is + allowed only to the super-user and is normally performed at boot time. + + GGeetthhoossttiidd() returns the 32-bit identifier for the current processor. + + This function has been deprecated. The hostid should be set or retrieved + by use of sysctl(2). + +SSEEEE AALLSSOO + sysctl(2), gethostname(3), sysctl(8). + +BBUUGGSS + 32 bits for the identifier is too small. + +HHIISSTTOORRYY + The ggeetthhoossttiidd() and sseetthhoossttiidd() syscalls appeared in 4.2BSD and were + dropped in 4.4BSD. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/setitimer.0 b/usr/share/man/cat2/setitimer.0 new file mode 100644 index 0000000000..d9a075530b --- /dev/null +++ b/usr/share/man/cat2/setitimer.0 @@ -0,0 +1,81 @@ +GETITIMER(2) BSD Programmer's Manual GETITIMER(2) + +NNAAMMEE + ggeettiittiimmeerr, sseettiittiimmeerr - get/set value of interval timer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##ddeeffiinnee IITTIIMMEERR__RREEAALL 00 + ##ddeeffiinnee IITTIIMMEERR__VVIIRRTTUUAALL 11 + ##ddeeffiinnee IITTIIMMEERR__PPRROOFF 22 + + _i_n_t + ggeettiittiimmeerr(_i_n_t _w_h_i_c_h, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_v_a_l_u_e); + + _i_n_t + sseettiittiimmeerr(_i_n_t _w_h_i_c_h, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_v_a_l_u_e, _s_t_r_u_c_t _i_t_i_m_e_r_v_a_l _*_o_v_a_l_u_e); + +DDEESSCCRRIIPPTTIIOONN + The system provides each process with three interval timers, defined in + <_s_y_s_/_t_i_m_e_._h>. The ggeettiittiimmeerr() call returns the current value for the + timer specified in _w_h_i_c_h in the structure at _v_a_l_u_e. The sseettiittiimmeerr() call + sets a timer to the specified _v_a_l_u_e (returning the previous value of the + timer if _o_v_a_l_u_e is non-nil). + + A timer value is defined by the _i_t_i_m_e_r_v_a_l structure: + + struct itimerval { + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ + }; + + If _i_t___v_a_l_u_e is non-zero, it indicates the time to the next timer expira- + tion. If _i_t___i_n_t_e_r_v_a_l is non-zero, it specifies a value to be used in + reloading _i_t___v_a_l_u_e when the timer expires. Setting _i_t___v_a_l_u_e to 0 dis- + ables a timer. Setting _i_t___i_n_t_e_r_v_a_l to 0 causes a timer to be disabled + after its next expiration (assuming _i_t___v_a_l_u_e is non-zero). + + Time values smaller than the resolution of the system clock are rounded + up to this resolution (typically 10 milliseconds). + + The ITIMER_REAL timer decrements in real time. A SIGALRM signal is de- + livered when this timer expires. + + The ITIMER_VIRTUAL timer decrements in process virtual time. It runs on- + ly when the process is executing. A SIGVTALRM signal is delivered when + it expires. + + The ITIMER_PROF timer decrements both in process virtual time and when + the system is running on behalf of the process. It is designed to be + used by interpreters in statistically profiling the execution of inter- + preted programs. Each time the ITIMER_PROF timer expires, the SIGPROF + signal is delivered. Because this signal may interrupt in-progress sys- + tem calls, programs using this timer must be prepared to restart inter- + rupted system calls. + +NNOOTTEESS + Three macros for manipulating time values are defined in <_s_y_s_/_t_i_m_e_._h>. + _T_i_m_e_r_c_l_e_a_r sets a time value to zero, _t_i_m_e_r_i_s_s_e_t tests if a time value is + non-zero, and _t_i_m_e_r_c_m_p compares two time values (beware that >= and <= do + not work with this macro). + +RREETTUURRNN VVAALLUUEESS + If the calls succeed, a value of 0 is returned. If an error occurs, the + value -1 is returned, and a more precise error code is placed in the + global variable _e_r_r_n_o. + +EERRRROORRSS + GGeettiittiimmeerr() and sseettiittiimmeerr() will fail if: + + [EFAULT] The _v_a_l_u_e parameter specified a bad address. + + [EINVAL] A _v_a_l_u_e parameter specified a time was too large to be han- + dled. + +SSEEEE AALLSSOO + select(2), sigvec(2), gettimeofday(2) + +HHIISSTTOORRYY + The ggeettiittiimmeerr function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/setlogin.0 b/usr/share/man/cat2/setlogin.0 new file mode 100644 index 0000000000..d949cd7aca --- /dev/null +++ b/usr/share/man/cat2/setlogin.0 @@ -0,0 +1,66 @@ +GETLOGIN(2) BSD Programmer's Manual GETLOGIN(2) + +NNAAMMEE + ggeettllooggiinn, sseettllooggiinn - get/set login name + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeettllooggiinn(_v_o_i_d); + + _i_n_t + sseettllooggiinn(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + The ggeettllooggiinn() routine returns the login name of the user associated with + the current session, as previously set by sseettllooggiinn(). The name is nor- + mally associated with a login shell at the time a session is created, and + is inherited by all processes descended from the login shell. (This is + true even if some of those processes assume another user ID, for example + when su(1) is used.) + + SSeettllooggiinn() sets the login name of the user associated with the current + session to _n_a_m_e. This call is restricted to the super-user, and is nor- + mally used only when a new session is being created on behalf of the + named user (for example, at login time, or when a remote shell is in- + voked). + +RREETTUURRNN VVAALLUUEESS + If a call to ggeettllooggiinn() succeeds, it returns a pointer to a null- + terminated string in a static buffer. If the name has not been set, it + returns NULL. If a call to sseettllooggiinn() succeeds, a value of 0 is returned. + If sseettllooggiinn() fails, a value of -1 is returned and an error code is + placed in the global location _e_r_r_n_o. + +EERRRROORRSS + The following errors may be returned by these calls: + + [EFAULT] The _n_a_m_e parameter gave an invalid address. + + [EINVAL] The _n_a_m_e parameter pointed to a string that was too long. + Login names are limited to MAXLOGNAME (from <_s_y_s_/_p_a_r_a_m_._h>) + characters, currently 12. + + [EPERM] The caller tried to set the login name and was not the su- + per-user. + +SSEEEE AALLSSOO + setsid(2) + +BBUUGGSS + Login names are limited in length by sseettllooggiinn(). However, lower limits + are placed on login names elsewhere in the system (UT_NAMESIZE in + <_u_t_m_p_._h>). + + In earlier versions of the system, ggeettllooggiinn() failed unless the process + was associated with a login terminal. The current implementation (using + sseettllooggiinn()) allows getlogin to succeed even when the process has no con- + trolling terminal. In earlier versions of the system, the value returned + by ggeettllooggiinn() could not be trusted without checking the user ID. + Portable programs should probably still make this check. + +HHIISSTTOORRYY + The ggeettllooggiinn() function first appeared in 4.4BSD. + +4.2 Berkeley Distribution June 9, 1993 1 diff --git a/usr/share/man/cat2/setpriority.0 b/usr/share/man/cat2/setpriority.0 new file mode 100644 index 0000000000..46200c6b99 --- /dev/null +++ b/usr/share/man/cat2/setpriority.0 @@ -0,0 +1,58 @@ +GETPRIORITY(2) BSD Programmer's Manual GETPRIORITY(2) + +NNAAMMEE + ggeettpprriioorriittyy, sseettpprriioorriittyy - get/set program scheduling priority + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o); + + _i_n_t + sseettpprriioorriittyy(_i_n_t _w_h_i_c_h, _i_n_t _w_h_o, _i_n_t _p_r_i_o); + +DDEESSCCRRIIPPTTIIOONN + The scheduling priority of the process, process group, or user, as indi- + cated by _w_h_i_c_h and _w_h_o is obtained with the ggeettpprriioorriittyy() call and set + with the sseettpprriioorriittyy() call. _W_h_i_c_h is one of PRIO_PROCESS, PRIO_PGRP, or + PRIO_USER, and _w_h_o is interpreted relative to _w_h_i_c_h (a process identifier + for PRIO_PROCESS, process group identifier for PRIO_PGRP, and a user ID + for PRIO_USER). A zero value of _w_h_o denotes the current process, process + group, or user. _P_r_i_o is a value in the range -20 to 20. The default + priority is 0; lower priorities cause more favorable scheduling. + + The ggeettpprriioorriittyy() call returns the highest priority (lowest numerical + value) enjoyed by any of the specified processes. The sseettpprriioorriittyy() call + sets the priorities of all of the specified processes to the specified + value. Only the super-user may lower priorities. + +RREETTUURRNN VVAALLUUEESS + Since ggeettpprriioorriittyy() can legitimately return the value -1, it is necessary + to clear the external variable _e_r_r_n_o prior to the call, then check it af- + terward to determine if a -1 is an error or a legitimate value. The + sseettpprriioorriittyy() call returns 0 if there is no error, or -1 if there is. + +EERRRROORRSS + GGeettpprriioorriittyy() and sseettpprriioorriittyy() will fail if: + + [ESRCH] No process was located using the _w_h_i_c_h and _w_h_o values spec- + ified. + + [EINVAL] _W_h_i_c_h was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER. + + In addition to the errors indicated above, sseettpprriioorriittyy() will fail if: + + [EPERM] A process was located, but neither its effective nor real + user ID matched the effective user ID of the caller. + + [EACCES] A non super-user attempted to lower a process priority. + +SSEEEE AALLSSOO + nice(1), fork(2), renice(8) + +HHIISSTTOORRYY + The ggeettpprriioorriittyy function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/setregid.0 b/usr/share/man/cat2/setregid.0 new file mode 100644 index 0000000000..d4fc879552 --- /dev/null +++ b/usr/share/man/cat2/setregid.0 @@ -0,0 +1,44 @@ +SETREGID(2) BSD Programmer's Manual SETREGID(2) + +NNAAMMEE + sseettrreeggiidd - set real and effective group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sseettrreeggiidd(_i_n_t _r_g_i_d, _i_n_t _e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The real and effective group ID's of the current process are set to the + arguments. Unprivileged users may change the real group ID to the effec- + tive group ID and vice-versa; only the super-user may make other changes. + + Supplying a value of -1 for either the real or effective group ID forces + the system to substitute the current ID in place of the -1 parameter. + + The sseettrreeggiidd(_f_u_n_c_t_i_o_n, _w_a_s, _i_n_t_e_n_d_e_d, _t_o, _a_l_l_o_w, _s_w_a_p_p_i_n_g) the real and + effective group IDs in set-group-ID programs to temporarily relinquish + the set-group-ID value. This function did not work correctly, and its + purpose is now better served by the use of the sseetteeggiidd() function (see + setuid(2)). + + When setting the real and effective group IDs to the same value, the + standard sseettggiidd() function is preferred. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + [EPERM] The current process is not the super-user and a change other + than changing the effective group-id to the real group-id was + specified. + +SSEEEE AALLSSOO + getgid(2), setegid(2), setgid(2), setuid(2) + +HHIISSTTOORRYY + The sseettrreeggiidd function call appeared in 4.2BSD and was dropped in 4.4BSD. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/setreuid.0 b/usr/share/man/cat2/setreuid.0 new file mode 100644 index 0000000000..3d4e84fce2 --- /dev/null +++ b/usr/share/man/cat2/setreuid.0 @@ -0,0 +1,41 @@ +SETREUID(2) BSD Programmer's Manual SETREUID(2) + +NNAAMMEE + sseettrreeuuiidd - set real and effective user ID's + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sseettrreeuuiidd(_i_n_t _r_u_i_d, _i_n_t _e_u_i_d); + +DDEESSCCRRIIPPTTIIOONN + The real and effective user IDs of the current process are set according + to the arguments. If _r_u_i_d or _e_u_i_d is -1, the current uid is filled in by + the system. Unprivileged users may change the real user ID to the effec- + tive user ID and vice-versa; only the super-user may make other changes. + + The sseettrreeuuiidd() function has been used to swap the real and effective user + IDs in set-user-ID programs to temporarily relinquish the set-user-ID + value. This purpose is now better served by the use of the sseetteeuuiidd() + function (see setuid(2)). + + When setting the real and effective user IDs to the same value, the stan- + dard sseettuuiidd() function is preferred. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + [EPERM] The current process is not the super-user and a change other + than changing the effective user-id to the real user-id was + specified. + +SSEEEE AALLSSOO + getuid(2), seteuid(2), setuid(2) + +HHIISSTTOORRYY + The sseettrreeuuiidd function call appeared in 4.2BSD and was dropped in 4.4BSD. + +4th Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/setrgid.0 b/usr/share/man/cat2/setrgid.0 new file mode 100644 index 0000000000..e914b6170a --- /dev/null +++ b/usr/share/man/cat2/setrgid.0 @@ -0,0 +1,35 @@ +SETRUID(3) BSD Programmer's Manual SETRUID(3) + +NNAAMMEE + sseettrruuiidd, sseettrrggiidd - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sseettrruuiidd(_u_i_d___t _r_u_i_d); + + _i_n_t + sseettrrggiidd(_g_i_d___t _r_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettrruuiidd() function (sseettrrggiidd()) sets the real user ID (group ID) of + the current process. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real + or effective ID, these functions return -1. + + The use of these calls is not portable. Their use is discouraged; they + will be removed in the future. + +SSEEEE AALLSSOO + setuid(2), setgid(2), seteuid(2), setegid(2), getuid(2), getgid(2) + +HHIISSTTOORRYY + The sseettrruuiidd() and sseettrrggiidd() syscalls appeared in 4.2BSD and were dropped + in 4.4BSD. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/setrlimit.0 b/usr/share/man/cat2/setrlimit.0 new file mode 100644 index 0000000000..be09c3506f --- /dev/null +++ b/usr/share/man/cat2/setrlimit.0 @@ -0,0 +1,113 @@ +GETRLIMIT(2) BSD Programmer's Manual GETRLIMIT(2) + +NNAAMMEE + ggeettrrlliimmiitt, sseettrrlliimmiitt - control maximum system resource consumption + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettrrlliimmiitt(_i_n_t _r_e_s_o_u_r_c_e, _s_t_r_u_c_t _r_l_i_m_i_t _*_r_l_p); + + _i_n_t + sseettrrlliimmiitt(_i_n_t _r_e_s_o_u_r_c_e, _s_t_r_u_c_t _r_l_i_m_i_t _*_r_l_p); + +DDEESSCCRRIIPPTTIIOONN + Limits on the consumption of system resources by the current process and + each process it creates may be obtained with the ggeettrrlliimmiitt() call, and + set with the sseettrrlliimmiitt() call. + + The _r_e_s_o_u_r_c_e parameter is one of the following: + + RLIMIT_CORE The largest size (in bytes) core file that may be creat- + ed. + + RLIMIT_CPU The maximum amount of cpu time (in seconds) to be used by + each process. + + RLIMIT_DATA The maximum size (in bytes) of the data segment for a + process; this defines how far a program may extend its + break with the sbrk(2) system call. + + RLIMIT_FSIZE The largest size (in bytes) file that may be created. + + RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into + memory using the mlock(2) function. + + RLIMIT_NOFILE The maximum number of open files for this process. + + RLIMIT_NPROC The maximum number of simultaneous processes for this us- + er id. + + RLIMIT_RSS The maximum size (in bytes) to which a process's resident + set size may grow. This imposes a limit on the amount of + physical memory to be given to a process; if memory is + tight, the system will prefer to take memory from pro- + cesses that are exceeding their declared resident set + size. + + RLIMIT_STACK The maximum size (in bytes) of the stack segment for a + process; this defines how far a program's stack segment + may be extended. Stack extension is performed automati- + cally by the system. + + A resource limit is specified as a soft limit and a hard limit. When a + soft limit is exceeded a process may receive a signal (for example, if + the cpu time or file size is exceeded), but it will be allowed to contin- + ue execution until it reaches the hard limit (or modifies its resource + limit). The _r_l_i_m_i_t structure is used to specify the hard and soft limits + on a resource, + + struct rlimit { + quad_t rlim_cur; /* current (soft) limit */ + quad_t rlim_max; /* hard limit */ + }; + + Only the super-user may raise the maximum limits. Other users may only + alter _r_l_i_m___c_u_r within the range from 0 to _r_l_i_m___m_a_x or (irreversibly) low- + er _r_l_i_m___m_a_x. + + An ``infinite'' value for a limit is defined as RLIM_INFINITY. + + Because this information is stored in the per-process information, this + system call must be executed directly by the shell if it is to affect all + future processes created by the shell; lliimmiitt is thus a built-in command + to csh(1). + + The system refuses to extend the data or stack space when the limits + would be exceeded in the normal way: a break call fails if the data space + limit is reached. When the stack limit is reached, the process receives + a segmentation fault (SIGSEGV); if this signal is not caught by a handler + using the signal stack, this signal will kill the process. + + A file I/O operation that would create a file larger that the process' + soft limit will cause the write to fail and a signal SIGXFSZ to be gener- + ated; this normally terminates the process, but may be caught. When the + soft cpu time limit is exceeded, a signal SIGXCPU is sent to the offend- + ing process. + +RREETTUURRNN VVAALLUUEESS + A 0 return value indicates that the call succeeded, changing or returning + the resource limit. A return value of -1 indicates that an error oc- + curred, and an error code is stored in the global location _e_r_r_n_o. + +EERRRROORRSS + GGeettrrlliimmiitt() and sseettrrlliimmiitt() will fail if: + + [EFAULT] The address specified for _r_l_p is invalid. + + [EPERM] The limit specified to sseettrrlliimmiitt() would have raised the + maximum limit value, and the caller is not the super-user. + +SSEEEE AALLSSOO + csh(1), quota(2), sigaltstack(2), sigvec(2), sysctl(3) + +BBUUGGSS + There should be lliimmiitt and uunnlliimmiitt commands in sh(1) as well as in csh. + +HHIISSTTOORRYY + The ggeettrrlliimmiitt function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/setruid.0 b/usr/share/man/cat2/setruid.0 new file mode 100644 index 0000000000..e914b6170a --- /dev/null +++ b/usr/share/man/cat2/setruid.0 @@ -0,0 +1,35 @@ +SETRUID(3) BSD Programmer's Manual SETRUID(3) + +NNAAMMEE + sseettrruuiidd, sseettrrggiidd - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sseettrruuiidd(_u_i_d___t _r_u_i_d); + + _i_n_t + sseettrrggiidd(_g_i_d___t _r_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettrruuiidd() function (sseettrrggiidd()) sets the real user ID (group ID) of + the current process. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real + or effective ID, these functions return -1. + + The use of these calls is not portable. Their use is discouraged; they + will be removed in the future. + +SSEEEE AALLSSOO + setuid(2), setgid(2), seteuid(2), setegid(2), getuid(2), getgid(2) + +HHIISSTTOORRYY + The sseettrruuiidd() and sseettrrggiidd() syscalls appeared in 4.2BSD and were dropped + in 4.4BSD. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/setsid.0 b/usr/share/man/cat2/setsid.0 new file mode 100644 index 0000000000..deedccd398 --- /dev/null +++ b/usr/share/man/cat2/setsid.0 @@ -0,0 +1,37 @@ +SETSID(2) BSD Programmer's Manual SETSID(2) + +NNAAMMEE + sseettssiidd - create session and set process group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _p_i_d___t + sseettssiidd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettssiidd function creates a new session. The calling process is the + session leader of the new session, is the process group leader of a new + process group and has no controlling terminal. The calling process is + the only process in either the session or the process group. + + Upon successful completion, the sseettssiidd function returns the value of the + process group ID of the new process group, which is the same as the pro- + cess ID of the calling process. + +EERRRROORRSS + If an error occurs, sseettssiidd returns -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EPERM] The calling process is already a process group leader, or + the process group ID of a process other than the calling + process matches the process ID of the calling process. + +SSEEEE AALLSSOO + setpgid(3), tcgetpgrp(3), tcsetpgrp(3) + +SSTTAANNDDAARRDDSS + The sseettssiidd function is expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/setsockopt.0 b/usr/share/man/cat2/setsockopt.0 new file mode 100644 index 0000000000..18647f0079 --- /dev/null +++ b/usr/share/man/cat2/setsockopt.0 @@ -0,0 +1,181 @@ +GETSOCKOPT(2) BSD Programmer's Manual GETSOCKOPT(2) + +NNAAMMEE + ggeettssoocckkoopptt, sseettssoocckkoopptt - get and set options on sockets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettssoocckkoopptt(_i_n_t _s, _i_n_t _l_e_v_e_l, _i_n_t _o_p_t_n_a_m_e, _v_o_i_d _*_o_p_t_v_a_l, _i_n_t _*_o_p_t_l_e_n); + + _i_n_t + sseettssoocckkoopptt(_i_n_t _s, _i_n_t _l_e_v_e_l, _i_n_t _o_p_t_n_a_m_e, _c_o_n_s_t _v_o_i_d _*_o_p_t_v_a_l, + _i_n_t _o_p_t_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeettssoocckkoopptt() and sseettssoocckkoopptt() manipulate the _o_p_t_i_o_n_s associated with a + socket. 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 socket level, _l_e_v_e_l is specified as SOL_SOCKET. To manipulate options + at any other level the protocol number of the appropriate protocol con- + trolling the option is supplied. For example, to indicate that an option + is to be interpreted by the TCP protocol, _l_e_v_e_l should be set to the pro- + tocol number of TCP; see getprotoent(3). + + The parameters _o_p_t_v_a_l and _o_p_t_l_e_n are used to access option values for + sseettssoocckkoopptt(). For ggeettssoocckkoopptt() they identify a buffer in which the value + for the requested option(s) are to be returned. For ggeettssoocckkoopptt(), _o_p_t_l_e_n + is a value-result parameter, initially containing the size of the buffer + pointed to by _o_p_t_v_a_l, and modified on return to indicate the actual size + of the value returned. If no option value is to be supplied or returned, + _o_p_t_v_a_l may be NULL. + + _O_p_t_n_a_m_e and any specified options are passed uninterpreted to the appro- + priate protocol module for interpretation. The include file + <_s_y_s_/_s_o_c_k_e_t_._h> 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_n_t parameter for _o_p_t_v_a_l. For + sseettssoocckkoopptt(), the parameter should be non-zero to enable a boolean op- + tion, or zero if the option is to be disabled. SO_LINGER uses a _s_t_r_u_c_t + _l_i_n_g_e_r parameter, defined in <_s_y_s_/_s_o_c_k_e_t_._h>, which specifies the desired + state of the option and the linger interval (see below). SO_SNDTIMEO and + SO_RCVTIMEO use a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter, defined in <_s_y_s_/_t_i_m_e_._h>. + + The following options are recognized at the socket level. Except as not- + ed, each may be examined with ggeettssoocckkoopptt() and set with sseettssoocckkoopptt(). + + SO_DEBUG enables recording of debugging information + SO_REUSEADDR enables local address reuse + SO_REUSEPORT enables duplicate address and port bindings + SO_KEEPALIVE enables keep connections alive + SO_DONTROUTE enables routing bypass for outgoing messages + SO_LINGER linger on close if data present + SO_BROADCAST enables permission to transmit broadcast messages + SO_OOBINLINE enables reception of out-of-band data in band + SO_SNDBUF set buffer size for output + SO_RCVBUF set buffer size for input + + + SO_SNDLOWAT set minimum count for output + SO_RCVLOWAT set minimum count for input + SO_SNDTIMEO set timeout value for output + SO_RCVTIMEO set timeout value for input + SO_TYPE get the type of the socket (get only) + SO_ERROR get and clear error on the socket (get only) + + SO_DEBUG enables debugging in the underlying protocol modules. + SO_REUSEADDR indicates that the rules used in validating addresses sup- + plied in a bind(2) call should allow reuse of local addresses. + SO_REUSEPORT allows completely duplicate bindings by multiple processes + if they all set SO_REUSEPORT before binding the port. This option per- + mits multiple instances of a program to each receive UDP/IP multicast or + broadcast datagrams destined for the bound port. SO_KEEPALIVE enables + the periodic transmission of messages on a connected socket. Should the + connected party fail to respond to these messages, the connection is con- + sidered broken and processes using the socket are notified via a SIGPIPE + signal when attempting to send data. SO_DONTROUTE indicates that outgo- + ing messages should bypass the standard routing facilities. Instead, + messages are directed to the appropriate network interface according to + the network portion of the destination address. + + SO_LINGER controls the action taken when unsent messags are queued on + socket and a close(2) is performed. If the socket promises reliable de- + livery of data and SO_LINGER is set, the system will block the process on + the close attempt until it is able to transmit the data or until it de- + cides it is unable to deliver the information (a timeout period, termed + the linger interval, is specified in the sseettssoocckkoopptt() call when SO_LINGER + is requested). If SO_LINGER is disabled and a close is issued, the sys- + tem will process the close in a manner that allows the process to contin- + ue as quickly as possible. + + The option SO_BROADCAST requests permission to send broadcast datagrams + on the socket. Broadcast was a privileged operation in earlier versions + of the system. With protocols that support out-of-band data, the + SO_OOBINLINE option requests that out-of-band data be placed in the nor- + mal data input queue as received; it will then be accessible with recv or + read calls without the MSG_OOB flag. Some protocols always behave as if + this option is set. SO_SNDBUF and SO_RCVBUF are options to adjust the + normal buffer sizes allocated for output and input buffers, respectively. + The buffer size may be increased for high-volume connections, or may be + decreased to limit the possible backlog of incoming data. The system + places an absolute limit on these values. + + SO_SNDLOWAT is an option to set the minimum count for output operations. + Most output operations process all of the data supplied by the call, de- + livering data to the protocol for transmission and blocking as necessary + for flow control. Nonblocking output operations will process as much da- + ta as permitted subject to flow control without blocking, but will pro- + cess no data if flow control does not allow the smaller of the low water + mark value or the entire request to be processed. A select(2) operation + testing the ability to write to a socket will return true only if the low + water mark amount could be processed. The default value for SO_SNDLOWAT + is set to a convenient size for network efficiency, often 1024. + SO_RCVLOWAT is an option to set the minimum count for input operations. + In general, receive calls will block until any (non-zero) amount of data + is received, then return with smaller of the amount available or the + amount requested. The default value for SO_RCVLOWAT is 1. If + SO_RCVLOWAT is set to a larger value, blocking receive calls normally + wait until they have received the smaller of the low water mark value or + the requested amount. Receive calls may still return less than the low + water mark if an error occurs, a signal is caught, or the type of data + next in the receive queue is different than that returned. + + SO_SNDTIMEO is an option to set a timeout value for output operations. + It accepts a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter with the number of seconds and mi- + croseconds used to limit waits for output operations to complete. If a + send operation has blocked for this much time, it returns with a partial + count or with the error EWOULDBLOCK if no data were sent. In the current + implementation, this timer is restarted each time additional data are de- + livered to the protocol, implying that the limit applies to output por- + tions ranging in size from the low water mark to the high water mark for + output. SO_RCVTIMEO is an option to set a timeout value for input opera- + tions. It accepts a _s_t_r_u_c_t _t_i_m_e_v_a_l parameter with the number of seconds + and microseconds used to limit waits for input operations to complete. + In the current implementation, this timer is restarted each time addi- + tional data are received by the protocol, and thus the limit is in effect + an inactivity timer. If a receive operation has been blocked for this + much time without receiving additional data, it returns with a short + count or with the error EWOULDBLOCK if no data were received. + + Finally, SO_TYPE and SO_ERROR are options used only with ggeettssoocckkoopptt(). + SO_TYPE returns the type of the socket, such as SOCK_STREAM; it is useful + for servers that inherit sockets on startup. SO_ERROR returns any pend- + ing error on the socket and clears the error status. It may be used to + check for asynchronous errors on connected datagram sockets or for other + asynchronous errors. + +RREETTUURRNN VVAALLUUEESS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EBADF] The argument _s is not a valid descriptor. + + [ENOTSOCK] The argument _s is a file, not a socket. + + [ENOPROTOOPT] The option is unknown at the level indicated. + + [EFAULT] The address pointed to by _o_p_t_v_a_l is not in a valid part of + the process address space. For ggeettssoocckkoopptt(), this error + may also be returned if _o_p_t_l_e_n is not in a valid part of + the process address space. + +SSEEEE AALLSSOO + ioctl(2), socket(2), getprotoent(3) protocols(5) + +BBUUGGSS + Several of the socket options should be handled at lower levels of the + system. + +HHIISSTTOORRYY + The ggeettssoocckkoopptt system call appeared in 4.2BSD. + +4.3-Reno Berkeley Distribution June 5, 1993 3 diff --git a/usr/share/man/cat2/settimeofday.0 b/usr/share/man/cat2/settimeofday.0 new file mode 100644 index 0000000000..b027fad7b1 --- /dev/null +++ b/usr/share/man/cat2/settimeofday.0 @@ -0,0 +1,62 @@ +GETTIMEOFDAY(2) BSD Programmer's Manual GETTIMEOFDAY(2) + +NNAAMMEE + ggeettttiimmeeooffddaayy, sseettttiimmeeooffddaayy - get/set date and time + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p); + + _i_n_t + sseettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p); + +DDEESSCCRRIIPPTTIIOONN + NNoottee:: ttiimmeezzoonnee iiss nnoo lloonnggeerr uusseedd;; tthhiiss iinnffoorrmmaattiioonn iiss kkeepptt oouuttssiiddee tthhee + kkeerrnneell.. The system's notion of the current Greenwich time and the cur- + rent time zone is obtained with the ggeettttiimmeeooffddaayy() call, and set with the + sseettttiimmeeooffddaayy() call. The time is expressed in seconds and microseconds + since midnight (0 hour), January 1, 1970. The resolution of the system + clock is hardware dependent, and the time may be updated continuously or + in ``ticks.'' If _t_p or _t_z_p is NULL, the associated time information will + not be returned or set. + + The structures pointed to by _t_p and _t_z_p are defined in <_s_y_s_/_t_i_m_e_._h> as: + + struct timeval { + long tv_sec; /* seconds since Jan. 1, 1970 */ + long tv_usec; /* and microseconds */ + }; + + struct timezone { + int tz_minuteswest; /* of Greenwich */ + int tz_dsttime; /* type of dst correction to apply */ + }; + + The _t_i_m_e_z_o_n_e structure indicates the local time zone (measured in minutes + of time westward from Greenwich), and a flag that, if nonzero, indicates + that Daylight Saving time applies locally during the appropriate part of + the year. + + Only the super-user may set the time of day or time zone. + +RREETTUURRNN + A 0 return value indicates that the call succeeded. A -1 return value + indicates an error occurred, and in this case an error code is stored in- + to the global variable _e_r_r_n_o. + +EERRRROORRSS + The following error codes may be set in _e_r_r_n_o: + + [EFAULT] An argument address referenced invalid memory. + + [EPERM] A user other than the super-user attempted to set the time. + +SSEEEE AALLSSOO + date(1), adjtime(2), ctime(3), timed(8) + +HHIISSTTOORRYY + The ggeettttiimmeeooffddaayy function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/setuid.0 b/usr/share/man/cat2/setuid.0 new file mode 100644 index 0000000000..21ebfbada1 --- /dev/null +++ b/usr/share/man/cat2/setuid.0 @@ -0,0 +1,57 @@ +SETUID(2) BSD Programmer's Manual SETUID(2) + +NNAAMMEE + sseettuuiidd, sseetteeuuiidd, sseettggiidd, sseetteeggiidd, - set user and group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseetteeuuiidd(_u_i_d___t _e_u_i_d); + + _i_n_t + sseettggiidd(_g_i_d___t _g_i_d); + + _i_n_t + sseetteeggiidd(_g_i_d___t _e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettuuiidd() function sets the real and effective user IDs and the saved + set-user-ID of the current process to the specified value. The sseettuuiidd() + function is permitted if the specified ID is equal to the real user ID of + the process, or if the effective user ID is that of the super user. + + The sseettggiidd() function sets the real and effective group IDs and the saved + set-group-ID of the current process to the specified value. The sseettggiidd() + function is permitted if the specified ID is equal to the real group ID + of the process, or if the effective user ID is that of the super user. + + The sseetteeuuiidd() function (sseetteeggiidd()) sets the effective user ID (group ID) + of the current process. The effective user ID may be set to the value of + the real user ID or the saved set-user-ID (see intro(2) and execve(2)); + in this way, the effective user ID of a set-user-ID executable may be + toggled by switching to the real user ID, then re-enabled by reverting to + the set-user-ID value. Similarly, the effective group ID may be set to + the value of the real group ID or the saved set-user-ID. + +RREETTUURRNN VVAALLUUEESS + Upon success, these functions return 0; otherwise -1 is returned. + + If the user is not the super user, or the uid specified is not the real, + effective ID, or saved ID, these functions return -1. + +SSEEEE AALLSSOO + getuid(2), getgid(2) + +SSTTAANNDDAARRDDSS + The sseettuuiidd() and sseettggiidd() functions are compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification with _POSIX_SAVED_IDS not de- + fined. The sseetteeuuiidd() and sseetteeggiidd() functions are extensions based on the + POSIX concept of _POSIX_SAVED_IDS, and have been proposed for a future + revision of the standard. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/shutdown.0 b/usr/share/man/cat2/shutdown.0 new file mode 100644 index 0000000000..1ec9d568d8 --- /dev/null +++ b/usr/share/man/cat2/shutdown.0 @@ -0,0 +1,36 @@ +SHUTDOWN(2) BSD Programmer's Manual SHUTDOWN(2) + +NNAAMMEE + sshhuuttddoowwnn - shut down part of a full-duplex connection + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sshhuuttddoowwnn(_i_n_t _s, _i_n_t _h_o_w); + +DDEESSCCRRIIPPTTIIOONN + The sshhuuttddoowwnn() call causes all or part of a full-duplex connection on the + socket associated with _s to be shut down. If _h_o_w is 0, further receives + will be disallowed. If _h_o_w is 1, further sends will be disallowed. If + _h_o_w is 2, further sends and receives will be disallowed. + +DDIIAAGGNNOOSSTTIICCSS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EBADF] _S is not a valid descriptor. + + [ENOTSOCK] _S is a file, not a socket. + + [ENOTCONN] The specified socket is not connected. + +SSEEEE AALLSSOO + connect(2), socket(2) + +HHIISSTTOORRYY + The sshhuuttddoowwnn function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/sigaction.0 b/usr/share/man/cat2/sigaction.0 new file mode 100644 index 0000000000..75cf0fe4ff --- /dev/null +++ b/usr/share/man/cat2/sigaction.0 @@ -0,0 +1,198 @@ +SIGACTION(2) BSD Programmer's Manual SIGACTION(2) + +NNAAMMEE + ssiiggaaccttiioonn - software signal facilities + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + struct sigaction { + void (*sa_handler)(); + sigset_t sa_mask; + int sa_flags; + }; + + ssiiggaaccttiioonn(_i_n_t _s_i_g, _s_t_r_u_c_t _s_i_g_a_c_t_i_o_n _*_a_c_t, _s_t_r_u_c_t _s_i_g_a_c_t_i_o_n _*_o_a_c_t); + +DDEESSCCRRIIPPTTIIOONN + The system defines a set of signals that may be delivered to a process. + Signal delivery resembles the occurrence of a hardware interrupt: the + signal is blocked from further occurrence, the current process context is + saved, and a new one is built. A process may specify a _h_a_n_d_l_e_r to which + a signal is delivered, or specify that a signal is to be _i_g_n_o_r_e_d. A pro- + cess may also specify that a default action is to be taken by the system + when a signal occurs. A signal may also be _b_l_o_c_k_e_d, in which case its + delivery is postponed until it is _u_n_b_l_o_c_k_e_d. The action to be taken on + delivery is determined at the time of delivery. Normally, signal han- + dlers execute on the current stack of the process. This may be changed, + on a per-handler basis, so that signals are taken on a special _s_i_g_n_a_l + _s_t_a_c_k. + + Signal routines execute with the signal that caused their invocation + _b_l_o_c_k_e_d, but other signals may yet occur. A global _s_i_g_n_a_l _m_a_s_k defines + the set of signals currently blocked from delivery to a process. The + signal mask for a process is initialized from that of its parent (normal- + ly empty). It may be changed with a sigprocmask(2) call, or when a sig- + nal is delivered to the process. + + When a signal condition arises for a process, the signal is added to a + set of signals pending for the process. If the signal is not currently + _b_l_o_c_k_e_d by the process then it is delivered to the process. Signals may + be delivered any time a process enters the operating system (e.g., during + a system call, page fault or trap, or clock interrupt). If multiple sig- + nals are ready to be delivered at the same time, any signals that could + be caused by traps are delivered first. Additional signals may be pro- + cessed at the same time, with each appearing to interrupt the handlers + for the previous signals before their first instructions. The set of + pending signals is returned by the sigpending(2) function. When a caught + signal is delivered, the current state of the process is saved, a new + signal mask is calculated (as described below), and the signal handler is + invoked. The call to the handler is arranged so that if the signal han- + dling routine returns normally the process will resume execution in the + context from before the signal's delivery. If the process wishes to re- + sume in a different context, then it must arrange to restore the previous + context itself. + + When a signal is delivered to a process a new signal mask is installed + for the duration of the process' signal handler (or until a sigprocmask + call is made). This mask is formed by taking the union of the current + signal mask set, the signal to be delivered, and the signal mask associ- + ated with the handler to be invoked. + + SSiiggaaccttiioonn() assigns an action for a specific signal. If _a_c_t is non-zero, + it specifies an action (SIG_DFL, SIG_IGN, or a handler routine) and mask + to be used when delivering the specified signal. If _o_a_c_t is non-zero, + the previous handling information for the signal is returned to the user. + + + Once a signal handler is installed, it remains installed until another + ssiiggaaccttiioonn() call is made, or an execve(2) is performed. A signal- + specific default action may be reset by setting _s_a___h_a_n_d_l_e_r to SIG_DFL. + The defaults are process termination, possibly with core dump; no action; + stopping the process; or continuing the process. See the signal list be- + low for each signal's default action. If _s_a___h_a_n_d_l_e_r is SIG_DFL, the de- + fault action for the signal is to discard the signal, and if a signal is + pending, the pending signal is discarded even if the signal is masked. + If _s_a___h_a_n_d_l_e_r is set to SIG_IGN current and pending instances of the sig- + nal are ignored and discarded. + + Options may be specified by setting _s_a___f_l_a_g_s. If the SA_NOCLDSTOP bit is + set when installing a catching function for the SIGCHLD signal, the + SIGCHLD signal will be generated only when a child process exits, not + when a child process stops. Further, if the SA_ONSTACK bit is set in + _s_a___f_l_a_g_s, the system will deliver the signal to the process on a _s_i_g_n_a_l + _s_t_a_c_k, specified with sigstack(2). + + If a signal is caught during the system calls listed below, the call may + be forced to terminate with the error EINTR, the call may return with a + data transfer shorter than requested, or the call may be restarted. + Restart of pending calls is requested by setting the SA_RESTART bit in + _s_a___f_l_a_g_s. The affected system calls include open(2), read(2), write(2), + sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications + channel or a slow device (such as a terminal, but not a regular file) and + during a wait(2) or ioctl(2). However, calls that have already committed + are not restarted, but instead return a partial success (for example, a + short read count). + + After a fork(2) or vfork(2) all signals, the signal mask, the signal + stack, and the restart/interrupt flags are inherited by the child. + + Execve(2) reinstates the default action for all signals which were caught + and resets all signals to be caught on the user stack. Ignored signals + remain ignored; the signal mask remains the same; signals that restart + pending system calls continue to do so. + + The following is a list of all signals with names as in the include file + <_s_i_g_n_a_l_._h>: + + NNAAMMEE DDeeffaauulltt AAccttiioonn DDeessccrriippttiioonn + SIGHUP terminate process terminal line hangup + SIGINT terminate process interrupt program + SIGQUIT create core image quit program + SIGILL create core image illegal instruction + SIGTRAP create core image trace trap + SIGABRT create core image abort(2) call (formerly SIGIOT) + SIGEMT create core image emulate instruction executed + SIGFPE create core image floating-point exception + SIGKILL terminate process kill program + SIGBUS create core image bus error + SIGSEGV create core image segmentation violation + SIGSYS create core image system call given invalid + argument + SIGPIPE terminate process write on a pipe with no reader + SIGALRM terminate process real-time timer expired + SIGTERM terminate process software termination signal + SIGURG discard signal urgent condition present on + socket + SIGSTOP stop process stop (cannot be caught or + ignored) + SIGTSTP stop process stop signal generated from + keyboard + + + SIGCONT discard signal continue after stop + SIGCHLD discard signal child status has changed + SIGTTIN stop process background read attempted from + control terminal + SIGTTOU stop process background write attempted to + control terminal + SIGIO discard signal I/O is possible on a descriptor + (see fcntl(2)) + SIGXCPU terminate process cpu time limit exceeded (see + setrlimit(2)) + SIGXFSZ terminate process file size limit exceeded (see + setrlimit(2)) + SIGVTALRM terminate process virtual time alarm (see + setitimer(2)) + SIGPROF terminate process profiling timer alarm (see + setitimer(2)) + SIGWINCH discard signal Window size change + SIGINFO discard signal status request from keyboard + SIGUSR1 terminate process User defined signal 1 + SIGUSR2 terminate process User defined signal 2 + +NNOOTTEE + The mask specified in _a_c_t is not allowed to block SIGKILL or SIGSTOP. + This is done silently by the system. + +RREETTUURRNN VVAALLUUEESS + A 0 value indicated that the call succeeded. A -1 return value indicates + an error occurred and _e_r_r_n_o is set to indicated the reason. + +EEXXAAMMPPLLEE + The handler routine can be declared: + + void handler(sig, code, scp) + int sig, code; + struct sigcontext *scp; + + Here _s_i_g is the signal number, into which the hardware faults and traps + are mapped. _C_o_d_e is a parameter that is either a constant or the code + provided by the hardware. _S_c_p is a pointer to the _s_i_g_c_o_n_t_e_x_t structure + (defined in <_s_i_g_n_a_l_._h>), used to restore the context from before the sig- + nal. + +EERRRROORRSS + SSiiggaaccttiioonn() will fail and no new signal handler will be installed if one + of the following occurs: + + [EFAULT] Either _a_c_t or _o_a_c_t points to memory that is not a valid + part of the process address space. + + [EINVAL] _S_i_g is not a valid signal number. + + [EINVAL] An attempt is made to ignore or supply a handler for + SIGKILL or SIGSTOP. + +SSTTAANNDDAARRDDSS + The ssiiggaaccttiioonn function is defined by IEEE Std1003.1-1988 (``POSIX''). The + SA_ONSTACK and SA_RESTART flags are Berkeley extensions, as are the sig- + nals, SIGTRAP, SIGEMT, SIGBUS, SIGSYS, SIGURG, SIGIO, SIGXCPU, SIGXFSZ, + SIGVTALRM, SIGPROF, SIGWINCH, and SIGINFO. Those signals are available on + most BSD-derived systems. + +SSEEEE AALLSSOO + kill(1), ptrace(2), kill(2), sigaction(2), sigprocmask(2), + sigsetops(2), sigsuspend(2), sigblock(2), sigsetmask(2), sigpause(2), + sigstack(2), sigvec(2), setjmp(3), siginterrupt(3), tty(4) + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat2/sigaltstack.0 b/usr/share/man/cat2/sigaltstack.0 new file mode 100644 index 0000000000..7f7956cc43 --- /dev/null +++ b/usr/share/man/cat2/sigaltstack.0 @@ -0,0 +1,90 @@ +SIGALTSTACK(2) BSD Programmer's Manual SIGALTSTACK(2) + +NNAAMMEE + ssiiggaallttssttaacckk - set and/or get signal stack context + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + struct sigaltstack { + caddr_t ss_sp; + long ss_size; + int ss_flags; + }; + + _i_n_t + ssiiggaallttssttaacckk(_c_o_n_s_t _s_t_r_u_c_t _s_i_g_a_l_t_s_t_a_c_k _*_s_s, _s_t_r_u_c_t _s_i_g_a_l_t_s_t_a_c_k _*_o_s_s); + +DDEESSCCRRIIPPTTIIOONN + SSiiggaallttssttaacckk() allows users to define an alternate stack on which signals + are to be processed. If _s_s is non-zero, it specifies a pointer to and + the size of a _s_i_g_n_a_l _s_t_a_c_k on which to deliver signals, and tells the + system if the process is currently executing on that stack. When a sig- + nal's action indicates its handler should execute on the signal stack + (specified with a sigaction(2) call), the system checks to see if the + process is currently executing on that stack. If the process is not cur- + rently executing on the signal stack, the system arranges a switch to the + signal stack for the duration of the signal handler's execution. + + If SA_DISABLE is set in _s_s___f_l_a_g_s, _s_s___s_p and _s_s___s_i_z_e are ignored and the + signal stack will be disabled. Trying to disable an active stack will + cause ssiiggaallttssttaacckk to return -1 with _e_r_r_n_o set to EINVAL. A disabled stack + will cause all signals to be taken on the regular user stack. If the + stack is later re-enabled then all signals that were specified to be pro- + cessed on an alternate stack will resume doing so. + + If _o_s_s is non-zero, the current signal stack state is returned. The + _s_s___f_l_a_g_s field will contain the value SA_ONSTACK if the process is cur- + rently on a signal stack and SA_DISABLE if the signal stack is currently + disabled. + +NNOOTTEESS + The value SIGSTKSZ is defined to be the number of bytes/chars that would + be used to cover the usual case when allocating an alternate stack area. + The following code fragment is typically used to allocate an alternate + stack. + + if ((sigstk.ss_sp = malloc(SIGSTKSZ)) == NULL) + /* error return */ + sigstk.ss_size = SIGSTKSZ; + sigstk.ss_flags = 0; + if (sigaltstack(&sigstk,0) < 0) + perror("sigaltstack"); + An alternative approach is provided for programs with signal handlers + that require a specific amount of stack space other than the default + size. The value MINSIGSTKSZ is defined to be the number of bytes/chars + that is required by the operating system to implement the alternate stack + feature. In computing an alternate stack size, programs should add + MINSIGSTKSZ to their stack requirements to allow for the operating system + overhead. + + Signal stacks are automatically adjusted for the direction of stack + growth and alignment requirements. Signal stacks may or may not be pro- + tected by the hardware and are not ``grown'' automatically as is done for + the normal stack. If the stack overflows and this space is not protected + unpredictable results may occur. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSiiggssttaacckk() will fail and the signal stack context will remain unchanged + if one of the following occurs. + + [EFAULT] Either _s_s or _o_s_s points to memory that is not a valid part of + the process address space. + + [EINVAL] An attempt was made to disable an active stack. + + [ENOMEM] Size of alternate stack area is less than or equal to + MINSIGSTKSZ. + +SSEEEE AALLSSOO + sigaction(2), setjmp(3) + +HHIISSTTOORRYY + The predecessor to ssiiggaallttssttaacckk, the ssiiggssttaacckk() system call, appeared in + 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/sigblock.0 b/usr/share/man/cat2/sigblock.0 new file mode 100644 index 0000000000..8cb3f3107a --- /dev/null +++ b/usr/share/man/cat2/sigblock.0 @@ -0,0 +1,35 @@ +SIGBLOCK(2) BSD Programmer's Manual SIGBLOCK(2) + +NNAAMMEE + ssiiggbblloocckk - block signals + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggbblloocckk(_i_n_t _m_a_s_k); + + _i_n_t + ssiiggmmaasskk(_s_i_g_n_u_m); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy:: sigprocmask(2). + + SSiiggbblloocckk() adds the signals specified in _m_a_s_k to the set of signals cur- + rently being blocked from delivery. Signals are blocked if the corre- + sponding bit in _m_a_s_k is a 1; the macro ssiiggmmaasskk() is provided to construct + the mask for a given _s_i_g_n_u_m. + + It is not possible to block SIGKILL or SIGSTOP; this restriction is + silently imposed by the system. + +RREETTUURRNN VVAALLUUEESS + The previous set of masked signals is returned. + +SSEEEE AALLSSOO + kill(2), sigprocmask(2), sigaction(2), sigsetmask(2), sigsetops(3) + +HHIISSTTOORRYY + The ssiiggbblloocckk function call appeared in 4.2BSD and has been deprecated. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/sigpause.0 b/usr/share/man/cat2/sigpause.0 new file mode 100644 index 0000000000..3f1aaf3851 --- /dev/null +++ b/usr/share/man/cat2/sigpause.0 @@ -0,0 +1,28 @@ +SIGPAUSE(2) BSD Programmer's Manual SIGPAUSE(2) + +NNAAMMEE + ssiiggppaauussee - atomically release blocked signals and wait for interrupt + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggppaauussee(_i_n_t _s_i_g_m_a_s_k); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy sigsuspend(2). + + SSiiggppaauussee() assigns _s_i_g_m_a_s_k to the set of masked signals and then waits + for a signal to arrive; on return the set of masked signals is restored. + _S_i_g_m_a_s_k is usually 0 to indicate that no signals are to be blocked. + SSiiggppaauussee() always terminates by being interrupted, returning -1 with + _e_r_r_n_o set to EINTR + +SSEEEE AALLSSOO + sigsuspend(2), kill(2), sigaction(2), sigprocmask(2), sigblock(2), + sigvec(2) + +HHIISSTTOORRYY + The ssiiggppaauussee function call appeared in 4.2BSD and has been deprecated. + +4th Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/sigpending.0 b/usr/share/man/cat2/sigpending.0 new file mode 100644 index 0000000000..7e4b56a497 --- /dev/null +++ b/usr/share/man/cat2/sigpending.0 @@ -0,0 +1,31 @@ +SIGPENDING(2) BSD Programmer's Manual SIGPENDING(2) + +NNAAMMEE + ssiiggppeennddiinngg - get pending signals + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggppeennddiinngg(_s_i_g_s_e_t___t _*_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggppeennddiinngg function returns a mask of the signals pending for deliv- + ery to the calling process in the location indicated by _s_e_t. Signals may + be pending because they are currently masked, or transiently before de- + livery (although the latter case is not normally detectable). + +RREETTUURRNN VVAALLUUEESS + A 0 value indicated that the call succeeded. A -1 return value indicates + an error occurred and _e_r_r_n_o is set to indicated the reason. + +EERRRROORRSS + The ssiiggppeennddiinngg function does not currently detect any errors. + +SSEEEE AALLSSOO + sigaction(2), sigprocmask(2) + +SSTTAANNDDAARRDDSS + The ssiiggppeennddiinngg function is defined by . + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/sigprocmask.0 b/usr/share/man/cat2/sigprocmask.0 new file mode 100644 index 0000000000..1390629b12 --- /dev/null +++ b/usr/share/man/cat2/sigprocmask.0 @@ -0,0 +1,55 @@ +SIGPROCMASK(2) BSD Programmer's Manual SIGPROCMASK(2) + +NNAAMMEE + ssiiggpprrooccmmaasskk - manipulate current signal mask + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggpprrooccmmaasskk(_i_n_t _h_o_w, _c_o_n_s_t _s_i_g_s_e_t___t _*_s_e_t, _s_i_g_s_e_t___t _*_o_s_e_t); + + ssiiggmmaasskk(_s_i_g_n_u_m); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggpprrooccmmaasskk() function examines and/or changes the current signal + mask (those signals that are blocked from delivery). Signals are blocked + if they are members of the current signal mask set. + + If _s_e_t is not null, the action of ssiiggpprrooccmmaasskk() depends on the value of + the parameter _h_o_w. The signal mask is changed as a function of the speci- + fied _s_e_t and the current mask. The function is specified by _h_o_w using + one of the following values from <_s_i_g_n_a_l_._h>: + + SIG_BLOCK The new mask is the union of the current mask and the speci- + fied _s_e_t. + + SIG_UNBLOCK The new mask is the intersection of the current mask and the + complement of the specified _s_e_t. + + SIG_SETMASK The current mask is replaced by the specified _s_e_t. + + If _o_s_e_t is not null, it is set to the previous value of the signal mask. + When _s_e_t is null, the value of _h_o_w is insignificant and the mask remains + unset providing a way to examine the signal mask without modification. + + The system quietly disallows SIGKILL or SIGSTOP to be blocked. + +RREETTUURRNN VVAALLUUEESS + A 0 value indicated that the call succeeded. A -1 return value indicates + an error occurred and _e_r_r_n_o is set to indicated the reason. + +EERRRROORRSS + The ssiiggpprrooccmmaasskk() call will fail and the signal mask will be unchanged if + one of the following occurs: + + [EINVAL] _h_o_w has a value other than those listed here. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsetops(3), sigsuspend(2) + +SSTTAANNDDAARRDDSS + The ssiiggpprrooccmmaasskk function call is expected to conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/sigreturn.0 b/usr/share/man/cat2/sigreturn.0 new file mode 100644 index 0000000000..f92b6e22b7 --- /dev/null +++ b/usr/share/man/cat2/sigreturn.0 @@ -0,0 +1,54 @@ +SIGRETURN(2) BSD Programmer's Manual SIGRETURN(2) + +NNAAMMEE + ssiiggrreettuurrnn - return from signal + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + struct sigcontext { + int sc_onstack; + int sc_mask; + int sc_sp; + int sc_fp; + int sc_ap; + int sc_pc; + int sc_ps; + }; + + _i_n_t + ssiiggrreettuurrnn(_s_t_r_u_c_t _s_i_g_c_o_n_t_e_x_t _*_s_c_p); + +DDEESSCCRRIIPPTTIIOONN + SSiiggrreettuurrnn() allows users to atomically unmask, switch stacks, and return + from a signal context. The processes signal mask and stack status are + restored from the context. The system call does not return; the users + stack pointer, frame pointer, argument pointer, and processor status + longword are restored from the context. Execution resumes at the speci- + fied pc. This system call is used by the trampoline code and longjmp(3) + when returning from a signal to the previously executing program. + +NNOOTTEESS + This system call is not available in 4.2 BSD hence it should not be used + if backward compatibility is needed. + +RREETTUURRNN VVAALLUUEESS + If successful, the system call does not return. Otherwise, a value of -1 + is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSiiggrreettuurrnn() will fail and the process context will remain unchanged if + one of the following occurs. + + [EFAULT] _S_c_p points to memory that is not a valid part of the process + address space. + + [EINVAL] The process status longword is invalid or would improperly + raise the privilege level of the process. + +SSEEEE AALLSSOO + sigvec(2), setjmp(3) + +HHIISSTTOORRYY + The ssiiggrreettuurrnn function call appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/sigsetmask.0 b/usr/share/man/cat2/sigsetmask.0 new file mode 100644 index 0000000000..a7f04e3e37 --- /dev/null +++ b/usr/share/man/cat2/sigsetmask.0 @@ -0,0 +1,33 @@ +SIGSETMASK(2) BSD Programmer's Manual SIGSETMASK(2) + +NNAAMMEE + ssiiggsseettmmaasskk - set current signal mask + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettmmaasskk(_i_n_t _m_a_s_k); + + ssiiggmmaasskk(_s_i_g_n_u_m); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleetteedd bbyy:: sigprocmask(2). + + SSiiggsseettmmaasskk() sets the current signal mask Signals are blocked from deliv- + ery if the corresponding bit in _m_a_s_k is a 1; the macro ssiiggmmaasskk() is pro- + vided to construct the mask for a given _s_i_g_n_u_m. + + The system quietly disallows SIGKILL or SIGSTOP to be blocked. + +RREETTUURRNN VVAALLUUEESS + The previous set of masked signals is returned. + +SSEEEE AALLSSOO + sigprocmask(2), kill(2), sigaction(2), sigsuspend(2), sigvec(2), + sigblock(2), sigsetops(3) + +HHIISSTTOORRYY + The ssiiggsseettmmaasskk function call appeared in 4.2BSD and has been deprecated. + +4.2 Berkeley Distribution June 2, 1993 1 diff --git a/usr/share/man/cat2/sigstack.0 b/usr/share/man/cat2/sigstack.0 new file mode 100644 index 0000000000..4f55d19f94 --- /dev/null +++ b/usr/share/man/cat2/sigstack.0 @@ -0,0 +1,16 @@ +SIGSTACK(2) BSD Programmer's Manual SIGSTACK(2) + +NNAAMMEE + ssiiggssttaacckk - set and/or get signal stack context + +DDEESSCCRRIIPPTTIIOONN + The ssiiggssttaacckk() function has been deprecated in favor of the interface de- + scribed in sigaltstack(2). + +SSEEEE AALLSSOO + sigaltstack(2) + +HHIISSTTOORRYY + The ssiiggssttaacckk function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/sigsuspend.0 b/usr/share/man/cat2/sigsuspend.0 new file mode 100644 index 0000000000..fa1bbed770 --- /dev/null +++ b/usr/share/man/cat2/sigsuspend.0 @@ -0,0 +1,35 @@ +SIGSUSPEND(2) BSD Programmer's Manual SIGSUSPEND(2) + +NNAAMMEE + ssiiggssuussppeenndd - atomically release blocked signals and wait for interrupt + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggssuussppeenndd(_c_o_n_s_t _s_i_g_s_e_t___t _*_s_i_g_m_a_s_k); + +DDEESSCCRRIIPPTTIIOONN + SSiiggssuussppeenndd() temporarily changes the blocked signal mask to the set to + which _s_i_g_m_a_s_k points, and then waits for a signal to arrive; on return + the previous set of masked signals is restored. The signal mask set is + usually empty to indicate that all signals are to be unblocked for the + duration of the call. + + In normal usage, a signal is blocked using sigprocmask(2) to begin a + critical section, variables modified on the occurrence of the signal are + examined to determine that there is no work to be done, and the process + pauses awaiting work by using ssiiggssuussppeenndd() with the previous mask re- + turned by sigprocmask. + +RREETTUURRNN VVAALLUUEESS + The ssiiggssuussppeenndd() function always terminates by being interrupted, return- + ing -1 with _e_r_r_n_o set to EINTR. + +SSEEEE AALLSSOO + sigprocmask(2), sigaction(2), sigsetops(3) + +SSTTAANNDDAARRDDSS + The ssiiggssuuppeenndd function call conforms to IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat2/sigvec.0 b/usr/share/man/cat2/sigvec.0 new file mode 100644 index 0000000000..8d006be60d --- /dev/null +++ b/usr/share/man/cat2/sigvec.0 @@ -0,0 +1,185 @@ +SIGVEC(2) BSD Programmer's Manual SIGVEC(2) + +NNAAMMEE + ssiiggvveecc - software signal facilities + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + struct sigvec { + void (*sv_handler)(); + sigset_t sv_mask; + int sv_flags; + }; + + ssiiggvveecc(_i_n_t _s_i_g, _s_t_r_u_c_t _s_i_g_v_e_c _*_v_e_c, _s_t_r_u_c_t _s_i_g_v_e_c _*_o_v_e_c); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy ssiiggaaccttiioonn((22)).. + + The system defines a set of signals that may be delivered to a process. + Signal delivery resembles the occurence of a hardware interrupt: the sig- + nal is blocked from further occurrence, the current process context is + saved, and a new one is built. A process may specify a _h_a_n_d_l_e_r to which + a signal is delivered, or specify that a signal is to be _b_l_o_c_k_e_d or + _i_g_n_o_r_e_d. A process may also specify that a default action is to be taken + by the system when a signal occurs. Normally, signal handlers execute on + the current stack of the process. This may be changed, on a per-handler + basis, so that signals are taken on a special _s_i_g_n_a_l _s_t_a_c_k. + + All signals have the same _p_r_i_o_r_i_t_y. Signal routines execute with the sig- + nal that caused their invocation _b_l_o_c_k_e_d, but other signals may yet oc- + cur. A global _s_i_g_n_a_l _m_a_s_k defines the set of signals currently blocked + from delivery to a process. The signal mask for a process is initialized + from that of its parent (normally 0). It may be changed with a sig- + block(2) or sigsetmask(2) call, or when a signal is delivered to the pro- + cess. + + When a signal condition arises for a process, the signal is added to a + set of signals pending for the process. If the signal is not currently + _b_l_o_c_k_e_d by the process then it is delivered to the process. When a sig- + nal is delivered, the current state of the process is saved, a new signal + mask is calculated (as described below), and the signal handler is in- + voked. The call to the handler is arranged so that if the signal han- + dling routine returns normally the process will resume execution in the + context from before the signal's delivery. If the process wishes to re- + sume in a different context, then it must arrange to restore the previous + context itself. + + When a signal is delivered to a process a new signal mask is installed + for the duration of the process' signal handler (or until a sigblock or + sigsetmask call is made). This mask is formed by taking the current sig- + nal mask, adding the signal to be delivered, and _o_r'ing in the signal + mask associated with the handler to be invoked. + + SSiiggvveecc() assigns a handler for a specific signal. If _v_e_c is non-zero, it + specifies a handler routine and mask to be used when delivering the spec- + ified signal. Further, if the SV_ONSTACK bit is set in _s_v___f_l_a_g_s, the + system will deliver the signal to the process on a _s_i_g_n_a_l _s_t_a_c_k, speci- + fied with sigaltstack(2). If _o_v_e_c is non-zero, the previous handling in- + formation for the signal is returned to the user. + + The following is a list of all signals with names as in the include file + <_s_i_g_n_a_l_._h>: + + + + + NNAAMMEE DDeeffaauulltt AAccttiioonn DDeessccrriippttiioonn + SIGHUP terminate process terminal line hangup + SIGINT terminate process interrupt program + SIGQUIT create core image quit program + SIGILL create core image illegal instruction + SIGTRAP create core image trace trap + SIGABRT create core image abort(2) call (formerly SIGIOT) + SIGEMT create core image emulate instruction executed + SIGFPE create core image floating-point exception + SIGKILL terminate process kill program + SIGBUS create core image bus error + SIGSEGV create core image segmentation violation + SIGSYS create core image system call given invalid + argument + SIGPIPE terminate process write on a pipe with no reader + SIGALRM terminate process real-time timer expired + SIGTERM terminate process software termination signal + SIGURG discard signal urgent condition present on + socket + SIGSTOP stop process stop (cannot be caught or + ignored) + SIGTSTP stop process stop signal generated from + keyboard + SIGCONT discard signal continue after stop + SIGCHLD discard signal child status has changed + SIGTTIN stop process background read attempted from + control terminal + SIGTTOU stop process background write attempted to + control terminal + SIGIO discard signal I/O is possible on a descriptor + (see fcntl(2)) + SIGXCPU terminate process cpu time limit exceeded (see + setrlimit(2)) + SIGXFSZ terminate process file size limit exceeded (see + setrlimit(2)) + SIGVTALRM terminate process virtual time alarm (see + setitimer(2)) + SIGPROF terminate process profiling timer alarm (see + setitimer(2)) + SIGWINCH discard signal Window size change + SIGINFO discard signal status request from keyboard + SIGUSR1 terminate process User defined signal 1 + SIGUSR2 terminate process User defined signal 2 + + Once a signal handler is installed, it remains installed until another + ssiiggvveecc() call is made, or an execve(2) is performed. A signal-specific + default action may be reset by setting _s_v___h_a_n_d_l_e_r to SIG_DFL. The de- + faults are process termination, possibly with core dump; no action; stop- + ping the process; or continuing the process. See the above signal list + for each signal's default action. If _s_v___h_a_n_d_l_e_r is SIG_IGN current and + pending instances of the signal are ignored and discarded. + + If a signal is caught during the system calls listed below, the call is + normally restarted. The call can be forced to terminate prematurely with + an EINTR error return by setting the SV_INTERRUPT bit in _s_v___f_l_a_g_s. The + affected system calls include read(2), write(2), sendto(2), + recvfrom(2), sendmsg(2) and recvmsg(2) on a communications channel or a + slow device (such as a terminal, but not a regular file) and during a + wait(2) or ioctl(2). However, calls that have already committed are not + restarted, but instead return a partial success (for example, a short + read count). + + After a fork(2) or vfork(2) all signals, the signal mask, the signal + stack, and the restart/interrupt flags are inherited by the child. + + + Execve(2) reinstates the default action for all signals which were caught + and resets all signals to be caught on the user stack. Ignored signals + remain ignored; the signal mask remains the same; signals that interrupt + system calls continue to do so. + +NNOOTTEESS + The mask specified in _v_e_c is not allowed to block SIGKILL or SIGSTOP. + This is done silently by the system. + + The SV_INTERRUPT flag is not available in 4.2BSD, hence it should not be + used if backward compatibility is needed. + +RREETTUURRNN VVAALLUUEESS + A 0 value indicated that the call succeeded. A -1 return value indicates + an error occurred and _e_r_r_n_o is set to indicated the reason. + +EERRRROORRSS + SSiiggvveecc() will fail and no new signal handler will be installed if one of + the following occurs: + + [EFAULT] Either _v_e_c or _o_v_e_c points to memory that is not a valid part of + the process address space. + + [EINVAL] _S_i_g is not a valid signal number. + + [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or + SIGSTOP. + +SSEEEE AALLSSOO + kill(1), kill(2), ptrace(2), sigaction(2), sigaltstack(2), + sigblock(2), sigpause(2), sigprocmask(2), sigsetmask(2), + sigsuspend(2), setjmp(3), siginterrupt(3), signal(3,) sigsetops(3), + tty(4) + +EEXXAAMMPPLLEE + On the VAX-11 The handler routine can be declared: + + void handler(sig, code, scp) + int sig, code; + struct sigcontext *scp; + + Here _s_i_g is the signal number, into which the hardware faults and traps + are mapped as defined below. _C_o_d_e is a parameter that is either a con- + stant as given below or, for compatibility mode faults, the code provided + by the hardware (Compatibility mode faults are distinguished from the + other SIGILL traps by having PSL_CM set in the psl). _S_c_p is a pointer to + the _s_i_g_c_o_n_t_e_x_t structure (defined in <_s_i_g_n_a_l_._h>), used to restore the + context from before the signal. + +BBUUGGSS + This manual page is still confusing. + +4th Berkeley Distribution June 2, 1993 3 diff --git a/usr/share/man/cat2/socket.0 b/usr/share/man/cat2/socket.0 new file mode 100644 index 0000000000..84a51a2409 --- /dev/null +++ b/usr/share/man/cat2/socket.0 @@ -0,0 +1,132 @@ +SOCKET(2) BSD Programmer's Manual SOCKET(2) + +NNAAMMEE + ssoocckkeett - create an endpoint for communication + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssoocckkeett(_i_n_t _d_o_m_a_i_n, _i_n_t _t_y_p_e, _i_n_t _p_r_o_t_o_c_o_l); + +DDEESSCCRRIIPPTTIIOONN + SSoocckkeett() creates an endpoint for communication and returns a descriptor. + + The _d_o_m_a_i_n parameter specifies a communications domain within which com- + munication will take place; this selects the protocol family which should + be used. These families are defined in the include file <_s_y_s_/_s_o_c_k_e_t_._h>. + The currently understood formats are + + AF_UNIX (UNIX internal protocols), + AF_INET (ARPA Internet protocols), + AF_ISO (ISO protocols), + AF_NS (Xerox Network Systems protocols), and + AF_IMPLINK (IMP host at IMP link layer). + + The socket has the indicated _t_y_p_e, which specifies the semantics of com- + munication. Currently defined types are: + + SOCK_STREAM + SOCK_DGRAM + SOCK_RAW + SOCK_SEQPACKET + SOCK_RDM + + A SOCK_STREAM type provides sequenced, reliable, two-way connection based + byte streams. An out-of-band data transmission mechanism may be support- + ed. A SOCK_DGRAM socket supports datagrams (connectionless, unreliable + messages of a fixed (typically small) maximum length). A SOCK_SEQPACKET + socket may provide a sequenced, reliable, two-way connection-based data + transmission path for datagrams of fixed maximum length; a consumer may + be required to read an entire packet with each read system call. This + facility is protocol specific, and presently implemented only for PF_NS. + SOCK_RAW sockets provide access to internal network protocols and inter- + faces. The types SOCK_RAW, which is available only to the super-user, + and SOCK_RDM, which is planned, but not yet implemented, are not de- + scribed here. + + The _p_r_o_t_o_c_o_l 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. However, it is possible that many + protocols may exist, in which case a particular protocol must be speci- + fied in this manner. The protocol number to use is particular to the + communication domain in which communication is to take place; see + protocols(5). + + Sockets of type SOCK_STREAM are full-duplex byte streams, similar to + pipes. A stream socket must be in a _c_o_n_n_e_c_t_e_d state before any data may + be sent or received on it. A connection to another socket is created + with a connect(2) call. Once connected, data may be transferred using + read(2) and write(2) calls or some variant of the send(2) and recv(2) + calls. When a session has been completed a close(2) may be performed. + Out-of-band data may also be transmitted as described in send(2) and re- + ceived as described in recv(2). + + + The communications protocols used to implement a SOCK_STREAM insure 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 broken and + calls will indicate an error with -1 returns and with ETIMEDOUT as the + specific code in the global variable _e_r_r_n_o. The protocols optionally keep + sockets ``warm'' by forcing transmissions roughly every minute in the ab- + sence of other activity. An error is then indicated if no response can + be elicited on an otherwise idle connection for a extended period (e.g. 5 + minutes). A SIGPIPE signal is raised if a process sends on a broken + stream; this causes naive processes, which do not handle the signal, to + exit. + + SOCK_SEQPACKET sockets employ the same system calls as SOCK_STREAM sock- + ets. The only difference is that read(2) calls will return only the + amount of data requested, and any remaining in the arriving packet will + be discarded. + + SOCK_DGRAM and SOCK_RAW sockets allow sending of datagrams to correspon- + dents named in send(2) calls. Datagrams are generally received with + recvfrom(2), which returns the next datagram with its return address. + + An fcntl(2) call can be used to specify a process group to receive a + SIGURG signal when the out-of-band data arrives. It may also enable non- + blocking I/O and asynchronous notification of I/O events via SIGIO. + + The operation of sockets is controlled by socket level _o_p_t_i_o_n_s. These op- + tions are defined in the file <_s_y_s_/_s_o_c_k_e_t_._h>. Setsockopt(2) and getsock- + opt(2) are used to set and get options, respectively. + +RREETTUURRNN VVAALLUUEESS + A -1 is returned if an error occurs, otherwise the return value is a de- + scriptor referencing the socket. + +EERRRROORRSS + The ssoocckkeett() call fails if: + + [EPROTONOSUPPORT] The protocol type or the specified protocol is not + supported within this domain. + + [EMFILE] The per-process descriptor table is full. + + [ENFILE] The system file table is full. + + [EACCESS] Permission to create a socket of the specified type + and/or protocol is denied. + + [ENOBUFS] Insufficient buffer space is available. The socket + cannot be created until sufficient resources are + freed. + +SSEEEE AALLSSOO + accept(2), bind(2), connect(2), getprotoent(3), getsockname(2), + getsockopt(2), ioctl(2), listen(2), read(2), recv(2), select(2), + send(2), shutdown(2), socketpair(2), write(2) + + _A_n _I_n_t_r_o_d_u_c_t_o_r_y _4_._3 _B_S_D _I_n_t_e_r_p_r_o_c_e_s_s _C_o_m_m_u_n_i_c_a_t_i_o_n _T_u_t_o_r_i_a_l, reprinted in + UNIX Programmer's Supplementary Documents Volume 1. + + _B_S_D _I_n_t_e_r_p_r_o_c_e_s_s _C_o_m_m_u_n_i_c_a_t_i_o_n _T_u_t_o_r_i_a_l, reprinted in UNIX Programmer's + Supplementary Documents Volume 1. + +HHIISSTTOORRYY + The ssoocckkeett function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/socketpair.0 b/usr/share/man/cat2/socketpair.0 new file mode 100644 index 0000000000..c94af58735 --- /dev/null +++ b/usr/share/man/cat2/socketpair.0 @@ -0,0 +1,49 @@ +SOCKETPAIR(2) BSD Programmer's Manual SOCKETPAIR(2) + +NNAAMMEE + ssoocckkeettppaaiirr - create a pair of connected sockets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssoocckkeettppaaiirr(_i_n_t _d, _i_n_t _t_y_p_e, _i_n_t _p_r_o_t_o_c_o_l, _i_n_t _*_s_v); + +DDEESSCCRRIIPPTTIIOONN + The ssoocckkeettppaaiirr() call creates an unnamed pair of connected sockets in the + specified domain _d, of the specified _t_y_p_e, and using the optionally spec- + ified _p_r_o_t_o_c_o_l. The descriptors used in referencing the new sockets are + returned in _s_v[0] and _s_v[1]. The two sockets are indistinguishable. + +DDIIAAGGNNOOSSTTIICCSS + A 0 is returned if the call succeeds, -1 if it fails. + +EERRRROORRSS + The call succeeds unless: + + [EMFILE] Too many descriptors are in use by this process. + + [EAFNOSUPPORT] The specified address family is not supported on this + machine. + + [EPROTONOSUPPORT] + The specified protocol is not supported on this ma- + chine. + + [EOPNOSUPPORT] The specified protocol does not support creation of + socket pairs. + + [EFAULT] The address _s_v does not specify a valid part of the + process address space. + +SSEEEE AALLSSOO + read(2), write(2), pipe(2) + +BBUUGGSS + This call is currently implemented only for the UNIX domain. + +HHIISSTTOORRYY + The ssoocckkeettppaaiirr function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/stat.0 b/usr/share/man/cat2/stat.0 new file mode 100644 index 0000000000..80cf30d689 --- /dev/null +++ b/usr/share/man/cat2/stat.0 @@ -0,0 +1,157 @@ +STAT(2) BSD Programmer's Manual STAT(2) + +NNAAMMEE + ssttaatt, llssttaatt, ffssttaatt - get file status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + llssttaatt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + + _i_n_t + ffssttaatt(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + The ssttaatt() function obtains information about the file pointed to by + _p_a_t_h. Read, write or execute permission of the named file is not re- + quired, but all directories listed in the path name leading to the file + must be seachable. + + LLssttaatt() is like ssttaatt() except in the case where the named file is a sym- + bolic link, in which case llssttaatt() returns information about the link, + while ssttaatt() returns information about the file the link references. Un- + like other filesystem objects, symbolic links do not have an owner, + group, access mode, times, etc. Instead, these attributes are taken from + the directory that contains the link. The only attributes returned from + an llssttaatt() that refer to the symbolic link itself are the file type + (S_IFLNK), size, blocks, and link count (always 1). + + The ffssttaatt() obtains the same information about an open file known by the + file descriptor _f_d, such as would be obtained by an open call. + + _B_u_f is a pointer to a ssttaatt() structure as defined by <_s_y_s_/_s_t_a_t_._h> (shown + below) and into which information is placed concerning the file. + + struct stat { + dev_t st_dev; /* device inode resides on */ + ino_t st_ino; /* inode's number */ + mode_t st_mode; /* inode protection mode */ + nlink_t st_nlink; /* number or hard links to the file */ + uid_t st_uid; /* user-id of owner */ + gid_t st_gid; /* group-id of owner */ + dev_t st_rdev; /* device type, for special file inode */ + off_t st_size; /* file size, in bytes */ + time_t st_atime; /* time of last access */ + long st_spare1; + time_t st_mtime; /* time of last data modification */ + long st_spare2; + time_t st_ctime; /* time of last file status change */ + long st_spare3; + long st_blksize;/* optimal file sys I/O ops blocksize */ + long st_blocks; /* blocks allocated for file */ + u_long st_flags; /* user defined flags for file */ + u_long st_gen; /* file generation number */ + }; + + The time-related fields of _s_t_r_u_c_t _s_t_a_t are as follows: + + st_atime Time when file data last accessed. Changed by the following + + + system calls: mknod(2), utimes(2), and read(2). + + st_mtime Time when file data last modified. Changed by the following + system calls: mknod(2), utimes(2), write(2). + + st_ctime Time when file status was last changed (inode data modifica- + tion). Changed by the following system calls: chmod(2) + chown(2), link(2), mknod(2), rename(2), unlink(2), + utimes(2), write(2). + + st_blocks The actual number of blocks allocated for the file in 512-byte + units. + + The status information word _s_t___m_o_d_e has bits: + + #define S_IFMT 0170000 /* type of file */ + #define S_IFIFO 0010000 /* named pipe (fifo) */ + #define S_IFCHR 0020000 /* character special */ + #define S_IFDIR 0040000 /* directory */ + #define S_IFBLK 0060000 /* block special */ + #define S_IFREG 0100000 /* regular */ + #define S_IFLNK 0120000 /* symbolic link */ + #define S_IFSOCK 0140000 /* socket */ + #define S_ISUID 0004000 /* set user id on execution */ + #define S_ISGID 0002000 /* set group id on execution */ + #define S_ISVTX 0001000 /* save swapped text even after use */ + #define S_IRUSR 0000400 /* read permission, owner */ + #define S_IWUSR 0000200 /* write permission, owner */ + #define S_IXUSR 0000100 /* execute/search permission, owner */ + + For a list of access modes, see <_s_y_s_/_s_t_a_t_._h>, access(2) and chmod(2). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSttaatt() and llssttaatt() will fail if: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EFAULT] _B_u_f or _n_a_m_e points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to + the file system. + + FFssttaatt() will fail if: + + [EBADF] _f_d is not a valid open file descriptor. + + + + [EFAULT] _B_u_f points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the file + system. + +CCAAVVEEAATT + The fields in the stat structure currently marked _s_t___s_p_a_r_e_1, _s_t___s_p_a_r_e_2, + and _s_t___s_p_a_r_e_3 are present in preparation for inode time stamps expanding + to 64 bits. This, however, can break certain programs that depend on the + time stamps being contiguous (in calls to utimes(2)). + +SSEEEE AALLSSOO + chmod(2), chown(2), utimes(2) symlink(7) + +BBUUGGSS + Applying fstat to a socket (and thus to a pipe) returns a zero'd buffer, + except for the blocksize field, and a unique device and inode number. + +SSTTAANNDDAARRDDSS + The ssttaatt() and ffssttaatt() function calls are expected to conform to IEEE Std + 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + A llssttaatt function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/statfs.0 b/usr/share/man/cat2/statfs.0 new file mode 100644 index 0000000000..3d84102942 --- /dev/null +++ b/usr/share/man/cat2/statfs.0 @@ -0,0 +1,93 @@ +STATFS(2) BSD Programmer's Manual STATFS(2) + +NNAAMMEE + ssttaattffss - get file system statistics + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssttaattffss(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f); + + _i_n_t + ffssttaattffss(_i_n_t _f_d, _s_t_r_u_c_t _s_t_a_t_f_s _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + SSttaattffss() returns information about a mounted file system. _P_a_t_h is the + path name of any file within the mounted filesystem. _B_u_f is a pointer to + a ssttaattffss() structure defined as follows: + + typedef quad fsid_t; + + #define MNAMELEN 32 /* length of buffer for returned name */ + + struct statfs { + short f_type; /* type of filesystem (see below) */ + short f_flags; /* copy of mount flags */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* 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 non-superuser */ + 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_spare[6]; /* spare for later */ + char f_mntonname[MNAMELEN]; /* mount point */ + char f_mntfromname[MNAMELEN]; /* mounted filesystem */ + }; + /* + * File system types. + */ + #define MOUNT_UFS 1 + #define MOUNT_NFS 2 + #define MOUNT_MFS 3 + #define MOUNT_PC 4 + + Fields that are undefined for a particular file system are set to -1. + FFssttaattffss() returns the same information about an open file referenced by + descriptor _f_d. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + SSttaattffss() fails if one or more of the following are true: + + [ENOTDIR] A component of the path prefix of _P_a_t_h is not a directory. + + [EINVAL] _p_a_t_h contains a character with the high-order bit set. + + [ENAMETOOLONG] + The length of a component of _p_a_t_h exceeds 255 characters, + + or the length of _p_a_t_h exceeds 1023 characters. + + [ENOENT] The file referred to by _p_a_t_h does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix of _p_a_t_h. + + [ELOOP] Too many symbolic links were encountered in translating + _p_a_t_h. + + [EFAULT] _B_u_f or _p_a_t_h points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + FFssttaattffss() fails if one or both of the following are true: + + [EBADF] _F_d is not a valid open file descriptor. + + [EFAULT] _B_u_f points to an invalid address. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + +HHIISSTTOORRYY + The ssttaattffss function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat2/swapon.0 b/usr/share/man/cat2/swapon.0 new file mode 100644 index 0000000000..6b0c96ebab --- /dev/null +++ b/usr/share/man/cat2/swapon.0 @@ -0,0 +1,74 @@ +SWAPON(2) BSD Programmer's Manual SWAPON(2) + +NNAAMMEE + sswwaappoonn - add a swap device for interleaved paging/swapping + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + sswwaappoonn(_c_o_n_s_t _c_h_a_r _*_s_p_e_c_i_a_l); + +DDEESSCCRRIIPPTTIIOONN + SSwwaappoonn() makes the block device _s_p_e_c_i_a_l available to the system for allo- + cation for paging and swapping. The names of potentially available de- + vices are known to the system and defined at system configuration time. + The size of the swap area on _s_p_e_c_i_a_l is calculated at the time the device + is first made available for swapping. + +RREETTUURRNN VVAALLUUEESS + If an error has occurred, a value of -1 is returned and _e_r_r_n_o is set to + indicate the error. + +EERRRROORRSS + SSwwaappoonn() succeeds unless: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named device does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EPERM] The caller is not the super-user. + + [ENOTBLK] _S_p_e_c_i_a_l is not a block device. + + [EBUSY] The device specified by _s_p_e_c_i_a_l has already been made + available for swapping + + [EINVAL] The device configured by _s_p_e_c_i_a_l was not configured into + the system as a swap device. + + [ENXIO] The major device number of _s_p_e_c_i_a_l is out of range (this + indicates no device driver exists for the associated hard- + ware). + + [EIO] An I/O error occurred while opening the swap device. + + [EFAULT] _S_p_e_c_i_a_l points outside the process's allocated address + space. + +SSEEEE AALLSSOO + swapon(8), config(8) + +BBUUGGSS + There is no way to stop swapping on a disk so that the pack may be dis- + mounted. + + This call will be upgraded in future versions of the system. + +HHIISSTTOORRYY + The sswwaappoonn function call appeared in 4.0BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/symlink.0 b/usr/share/man/cat2/symlink.0 new file mode 100644 index 0000000000..eed3a8fc22 --- /dev/null +++ b/usr/share/man/cat2/symlink.0 @@ -0,0 +1,87 @@ +SYMLINK(2) BSD Programmer's Manual SYMLINK(2) + +NNAAMMEE + ssyymmlliinnkk - make symbolic link to a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssyymmlliinnkk(_c_o_n_s_t _c_h_a_r _*_n_a_m_e_1, _c_o_n_s_t _c_h_a_r _*_n_a_m_e_2); + +DDEESSCCRRIIPPTTIIOONN + A symbolic link _n_a_m_e_2 is created to _n_a_m_e_1 (_n_a_m_e_2 is the name of the file + created, _n_a_m_e_1 is the string used in creating the symbolic link). Either + name may be an arbitrary path name; the files need not be on the same + file system. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a zero value is returned. If an error oc- + curs, the error code is stored in _e_r_r_n_o and a -1 value is returned. + +EERRRROORRSS + The symbolic link succeeds unless: + + [ENOTDIR] + A component of the _n_a_m_e_2 prefix is not a directory. + + [EINVAL] Either _n_a_m_e_1 or _n_a_m_e_2 contains a character with the high-order + bit set. + + [ENAMETOOLONG] + A component of either pathname exceeded 255 characters, or the + entire length of either path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] A component of the _n_a_m_e_2 path prefix denies search permission. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EEXIST] _N_a_m_e_2 already exists. + + [EIO] An I/O error occurred while making the directory entry for + _n_a_m_e_2, or allocating the inode for _n_a_m_e_2, or writing out the + link contents of _n_a_m_e_2. + + [EROFS] The file _n_a_m_e_2 would reside on a read-only file system. + + [ENOSPC] The directory in which the entry for the new symbolic link is + being placed cannot be extended because there is no space left + on the file system containing the directory. + + [ENOSPC] The new symbolic link cannot be created because there there is + no space left on the file system that will contain the symbolic + link. + + [ENOSPC] There are no free inodes on the file system on which the sym- + bolic link is being created. + + [EDQUOT] The directory in which the entry for the new symbolic link is + being placed cannot be extended because the user's quota of + disk blocks on the file system containing the directory has + + + been exhausted. + + [EDQUOT] The new symbolic link cannot be created because the user's quo- + ta of disk blocks on the file system that will contain the sym- + bolic link has been exhausted. + + [EDQUOT] The user's quota of inodes on the file system on which the sym- + bolic link is being created has been exhausted. + + [EIO] An I/O error occurred while making the directory entry or allo- + cating the inode. + + [EFAULT] _N_a_m_e_1 or _n_a_m_e_2 points outside the process's allocated address + space. + +SSEEEE AALLSSOO + link(2), ln(1), unlink(2) + +HHIISSTTOORRYY + The ssyymmlliinnkk function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/sync.0 b/usr/share/man/cat2/sync.0 new file mode 100644 index 0000000000..598b52434e --- /dev/null +++ b/usr/share/man/cat2/sync.0 @@ -0,0 +1,31 @@ +SYNC(2) BSD Programmer's Manual SYNC(2) + +NNAAMMEE + ssyynncc - synchronize disk block in-core status with that on disk + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ssyynncc(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssyynncc() function forces a write of dirty (modified) buffers in the + block buffer cache out to disk. The kernel keeps this information in core + to reduce the number of disk I/O transfers required by the system. As + information in the cache is lost after a system crash a ssyynncc() call is + issued frequently by the user process update(8) (about every 30 seconds). + + The function fsync(2) may be used to synchronize individual file descrip- + tor attributes. + +SSEEEE AALLSSOO + fsync(2), sync(8), update(8) + +BBUUGGSS + SSyynncc() may return before the buffers are completely flushed. + +HHIISSTTOORRYY + A ssyynncc function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/syscall.0 b/usr/share/man/cat2/syscall.0 new file mode 100644 index 0000000000..86df1c0e55 --- /dev/null +++ b/usr/share/man/cat2/syscall.0 @@ -0,0 +1,37 @@ +SYSCALL(2) BSD Programmer's Manual SYSCALL(2) + +NNAAMMEE + ssyyssccaallll, ____ssyyssccaallll - indirect system call + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssyyssccaallll(_i_n_t _n_u_m_b_e_r, _._._.); + + _i_n_t + ____ssyyssccaallll(_q_u_a_d___t _n_u_m_b_e_r, _._._.); + +DDEESSCCRRIIPPTTIIOONN + SSyyssccaallll() performs the system call whose assembly language interface has + the specified _n_u_m_b_e_r with the specified arguments. Symbolic constants + for system calls can be found in the header file <_s_y_s_/_s_y_s_c_a_l_l_._h>. The + ____ssyyssccaallll form should be used when one or more of the parameters is a + 64-bit argument to ensure that argument alignment is correct. This sys- + tem call is useful for testing new system calls that do not have entries + in the C library. + +RREETTUURRNN VVAALLUUEESS + The return values are defined by the system call being invoked. In gen- + eral, a 0 return value indicates success. A -1 return value indicates an + error, and an error code is stored in _e_r_r_n_o. + +BBUUGGSS + There is no way to simulate system calls that have multiple return values + such as pipe(2). + +HHIISSTTOORRYY + The ssyyssccaallll function call appeared in 4.0BSD. + +4th Berkeley Distribution June 16, 1993 1 diff --git a/usr/share/man/cat2/truncate.0 b/usr/share/man/cat2/truncate.0 new file mode 100644 index 0000000000..9d0c8ffd2a --- /dev/null +++ b/usr/share/man/cat2/truncate.0 @@ -0,0 +1,75 @@ +TRUNCATE(2) BSD Programmer's Manual TRUNCATE(2) + +NNAAMMEE + ttrruunnccaattee, ffttrruunnccaattee - truncate a file to a specified length + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttrruunnccaattee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _o_f_f___t _l_e_n_g_t_h); + + _i_n_t + ffttrruunnccaattee(_i_n_t _f_d, _o_f_f___t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + TTrruunnccaattee() causes the file named by _p_a_t_h or referenced by _f_d to be trun- + cated to at most _l_e_n_g_t_h bytes in size. If the file previously was larger + than this size, the extra data is lost. With ffttrruunnccaattee(), the file must + be open for writing. + +RREETTUURRNN VVAALLUUEESS + A value of 0 is returned if the call succeeds. If the call fails a -1 is + returned, and the global variable _e_r_r_n_o specifies the error. + +EERRRROORRSS + TTrruunnccaattee() succeeds unless: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path pre- + fix. + + [EACCES] The named file is not writable by the user. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EISDIR] The named file is a directory. + + [EROFS] The named file resides on a read-only file system. + + [ETXTBSY] The file is a pure procedure (shared text) file that is being + executed. + + [EIO] An I/O error occurred updating the inode. + + [EFAULT] _P_a_t_h points outside the process's allocated address space. + + FFttrruunnccaattee() succeeds unless: + + [EBADF] The _f_d is not a valid descriptor. + + [EINVAL] The _f_d references a socket, not a file. + + [EINVAL] The _f_d is not open for writing. + +SSEEEE AALLSSOO + open(2) + +BBUUGGSS + These calls should be generalized to allow ranges of bytes in a file to + be discarded. + +HHIISSTTOORRYY + The ttrruunnccaattee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/umask.0 b/usr/share/man/cat2/umask.0 new file mode 100644 index 0000000000..428d96b042 --- /dev/null +++ b/usr/share/man/cat2/umask.0 @@ -0,0 +1,36 @@ +UMASK(2) BSD Programmer's Manual UMASK(2) + +NNAAMMEE + uummaasskk - set file creation mode mask + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _m_o_d_e___t + uummaasskk(_m_o_d_e___t _n_u_m_a_s_k); + +DDEESSCCRRIIPPTTIIOONN + The uummaasskk() routine sets the process's file mode creation mask to _n_u_m_a_s_k + and returns the previous value of the mask. The 9 low-order access per- + mission bits of _n_u_m_a_s_k are used by system calls, including open(2), + mkdir(2), and mkfifo(2), to turn off corresponding bits requested in + file mode. (See chmod(2)). This clearing allows each user to restrict + the default access to his files. + + The default mask value is S_IWGRP|S_IWOTH (022, write access for the own- + er only). Child processes inherit the mask of the calling process. + +RREETTUURRNN VVAALLUUEESS + The previous value of the file mode mask is returned by the call. + +EERRRROORRSS + The uummaasskk() function is always successful. + +SSEEEE AALLSSOO + chmod(2), mknod(2), open(2) + +SSTTAANNDDAARRDDSS + The uummaasskk() function call is expected to conform to IEEE Std 1003.1-1988 + (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/unlink.0 b/usr/share/man/cat2/unlink.0 new file mode 100644 index 0000000000..9cfb399ad9 --- /dev/null +++ b/usr/share/man/cat2/unlink.0 @@ -0,0 +1,71 @@ +UNLINK(2) BSD Programmer's Manual UNLINK(2) + +NNAAMMEE + uunnlliinnkk - remove directory entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + uunnlliinnkk(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); + +DDEESSCCRRIIPPTTIIOONN + The uunnlliinnkk() function removes the link named by _p_a_t_h from its directory + and decrements the link count of the file which was referenced by the + link. If that decrement reduces the link count of the file to zero, and + no process has the file open, then all resources associated with the file + are reclaimed. If one or more process have the file open when the last + link is removed, the link is removed, but the removal of the file is de- + layed until all references to it have been closed. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + The uunnlliinnkk() succeeds unless: + + [ENOTDIR] A component of the path prefix is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [EACCES] Search permission is denied for a component of the path + prefix. + + [EACCES] Write permission is denied on the directory containing + the link to be removed. + + [ELOOP] Too many symbolic links were encountered in translating + the pathname. + + [EPERM] The named file is a directory and the effective user ID + of the process is not the super-user. + + [EPERM] The directory containing the file is marked sticky, and + neither the containing directory nor the file to be re- + moved are owned by the effective user ID. + + [EBUSY] The entry to be unlinked is the mount point for a mounted + file system. + + [EIO] An I/O error occurred while deleting the directory entry + or deallocating the inode. + + [EROFS] The named file resides on a read-only file system. + + [EFAULT] _P_a_t_h points outside the process's allocated address + space. + +SSEEEE AALLSSOO + close(2), link(2), rmdir(2) symlink(7) + +HHIISSTTOORRYY + An uunnlliinnkk function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/unmount.0 b/usr/share/man/cat2/unmount.0 new file mode 100644 index 0000000000..aac3736939 --- /dev/null +++ b/usr/share/man/cat2/unmount.0 @@ -0,0 +1,202 @@ +MOUNT(2) BSD Programmer's Manual MOUNT(2) + +NNAAMMEE + mmoouunntt, uunnmmoouunntt - mount or dismount a filesystem + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + mmoouunntt(_i_n_t _t_y_p_e, _c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s, _c_a_d_d_r___t _d_a_t_a); + + _i_n_t + uunnmmoouunntt(_c_o_n_s_t _c_h_a_r _*_d_i_r, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The mmoouunntt() function grafts a filesystem object onto the system file tree + at the point _d_i_r. The argument _d_a_t_a describes the filesystem object to be + mounted. The argument _t_y_p_e tells the kernel how to interpret _d_a_t_a (See + _t_y_p_e below). The contents of the filesystem become available through the + new mount point _d_i_r. Any files in _d_i_r at the time of a successful mount + are swept under the carpet so to speak, and are unavailable until the + filesystem is unmounted. + + The following _f_l_a_g_s may be specified to suppress default semantics which + affect filesystem access. + + MNT_RDONLY The filesystem should be treated as read-only; Even the + super-user may not write on it. + + MNT_NOEXEC Do not allow files to be executed from the filesystem. + + MNT_NOSUID Do not honor setuid or setgid bits on files when execut- + ing them. + + MNT_NODEV Do not interpret special files on the filesystem. + + MNT_SYNCHRONOUS All I/O to the filesystem should be done synchronously. + + The flag MNT_UPDATE indicates that the mount command is being applied to + an already mounted filesystem. This allows the mount flags to be changed + without requiring that the filesystem be unmounted and remounted. Some + filesystems may not allow all flags to be changed. For example, most + filesystems will not allow a change from read-write to read-only. + + The _t_y_p_e argument defines the type of the filesystem. The types of + filesystems known to the system are defined in <_s_y_s_/_m_o_u_n_t_._h>. _D_a_t_a is a + pointer to a structure that contains the type specific arguments to + mount. The currently supported types of filesystems and their type spe- + cific data are: + + MOUNT_UFS + struct ufs_args { + char *fspec; /* Block special file to mount */ + int exflags; /* export related flags */ + uid_t exroot; /* mapping for root uid */ + }; + + MOUNT_NFS + struct nfs_args { + struct sockaddr_in *addr; /* file server address */ + nfsv2fh_t *fh; /* File handle to be mounted */ + int flags; /* flags */ + int wsize; /* write size in bytes */ + int rsize; /* read size in bytes */ + int timeo; /* initial timeout 0.1 secs */ + int retrans; /* times to retry send */ + char *hostname; /* server's name */ + }; + + MOUNT_MFS + struct mfs_args { + char *name; /* name of backing process */ + caddr_t base; /* base address of the filesystem */ + u_long size; /* size of the filesystem */ + }; + + The uummoouunntt() function call disassociates the filesystem from the speci- + fied mount point _d_i_r. + + The _f_l_a_g_s argument may specify MNT_FORCE to specify that the filesystem + should be forcibly unmounted even if files are still active. Active spe- + cial devices continue to work, but any further accesses to any other ac- + tive files result in errors even if the filesystem is later remounted. + +RREETTUURRNN VVAALLUUEESS + The mmoouunntt() returns the value 0 if the mount was successful, otherwise -1 + is returned and the variable _e_r_r_n_o is set to indicate the error. + + UUmmoouunntt returns the value 0 if the umount succeeded; otherwise -1 is re- + turned and the variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + MMoouunntt() will fail when one of the following occurs: + + [EPERM] The caller is not the super-user. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or the en- + tire length of a path name exceeded 1023 characters. + + [ELOOP] Too many symbolic links were encountered in translating a + pathname. + + [ENOENT] A component of _d_i_r does not exist. + + [ENOTDIR] A component of _n_a_m_e is not a directory, or a path prefix of + _s_p_e_c_i_a_l is not a directory. + + [EINVAL] A pathname contains a character with the high-order bit set. + + [EBUSY] Another process currently holds a reference to _d_i_r. + + [EFAULT] _D_i_r points outside the process's allocated address space. + + The following errors can occur for a _u_f_s filesystem mount: + + [ENODEV] A component of ufs_args _f_s_p_e_c does not exist. + + [ENOTBLK] _F_s_p_e_c is not a block device. + + [ENXIO] The major device number of _f_s_p_e_c is out of range (this indi- + cates no device driver exists for the associated hardware). + + [EBUSY] _F_s_p_e_c is already mounted. + + [EMFILE] No space remains in the mount table. + + [EINVAL] The super block for the filesystem had a bad magic number or + + + an out of range block size. + + [ENOMEM] Not enough memory was available to read the cylinder group in- + formation for the filesystem. + + [EIO] An I/O error occurred while reading the super block or cylin- + der group information. + + [EFAULT] _F_s_p_e_c points outside the process's allocated address space. + + The following errors can occur for a _n_f_s filesystem mount: + + [ETIMEDOUT] + _N_f_s timed out trying to contact the server. + + [EFAULT] Some part of the information described by nfs_args points out- + side the process's allocated address space. + + The following errors can occur for a _m_f_s filesystem mount: + + [EMFILE] No space remains in the mount table. + + [EINVAL] The super block for the filesystem had a bad magic number or + an out of range block size. + + [ENOMEM] Not enough memory was available to read the cylinder group in- + formation for the filesystem. + + [EIO] An paging error occurred while reading the super block or + cylinder group information. + + [EFAULT] _N_a_m_e points outside the process's allocated address space. + + UUmmoouunntt may fail with one of the following errors: + + [EPERM] The caller is not the super-user. + + [ENOTDIR] A component of the path is not a directory. + + [EINVAL] The pathname contains a character with the high-order bit set. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an en- + tire path name exceeded 1023 characters. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [EINVAL] The requested directory is not in the mount table. + + [EBUSY] A process is holding a reference to a file located on the + filesystem. + + [EIO] An I/O error occurred while writing cached filesystem informa- + tion. + + [EFAULT] _D_i_r points outside the process's allocated address space. + + A _u_f_s or _m_f_s mount can also fail if the maximum number of filesystems are + currently mounted. + +SSEEEE AALLSSOO + mount(8), umount(8), mfs(8) + +BBUUGGSS + Some of the error codes need translation to more obvious messages. + +HHIISSTTOORRYY + MMoouunntt() and uummoouunntt() function calls appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution July 11, 1993 4 diff --git a/usr/share/man/cat2/utimes.0 b/usr/share/man/cat2/utimes.0 new file mode 100644 index 0000000000..0c600be6e4 --- /dev/null +++ b/usr/share/man/cat2/utimes.0 @@ -0,0 +1,70 @@ +UTIMES(2) BSD Programmer's Manual UTIMES(2) + +NNAAMMEE + uuttiimmeess - set file access and modification times + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + uuttiimmeess(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_i_m_e_s); + +DDEESSCCRRIIPPTTIIOONN + The uuttiimmeess() function sets the access and modification times of the named + file from the structures in the argument array _t_i_m_e_s. + + The first structure is the access time, and the second is the modifica- + tion time. + + If the times are specified (the _t_i_m_e_s argument is non-NULL) the caller + must be the owner of the file or be the super-user. + + If the times are not specified (the _t_i_m_e_s argument is NULL) the caller + must be the owner of the file, have permission to write the file, or be + the super-user. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + UUttiimmeess() will fail if: + + [EACCES] Search permission is denied for a component of the path + prefix; or the _t_i_m_e_s argument is NULL and the effective us- + er ID of the process does not match the owner of the file, + and is not the super-user, and write access is denied. + + [EFAULT] File or _t_i_m_e_s points outside the process's allocated ad- + dress space. + + [EINVAL] The pathname contains a character with the high-order bit + set. + + [EIO] An I/O error occurred while reading or writing the affected + inode. + + [ELOOP] Too many symbolic links were encountered in translating the + pathname. + + [ENAMETOOLONG] + A component of a pathname exceeded 255 characters, or an + entire path name exceeded 1023 characters. + + [ENOENT] The named file does not exist. + + [ENOTDIR] A component of the path prefix is not a directory. + + [EPERM] The _t_i_m_e_s argument is not NULL and the calling process's + effective user ID does not match the owner of the file and + is not the super-user. + + [EROFS] The file system containing the file is mounted read-only. + +SSEEEE AALLSSOO + stat(2) + +HHIISSTTOORRYY + The uuttiimmeess function call appeared in 4.2BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/vfork.0 b/usr/share/man/cat2/vfork.0 new file mode 100644 index 0000000000..09b6ce202c --- /dev/null +++ b/usr/share/man/cat2/vfork.0 @@ -0,0 +1,53 @@ +VFORK(2) BSD Programmer's Manual VFORK(2) + +NNAAMMEE + vvffoorrkk - spawn new process in a virtual memory efficient way + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + vvffoorrkk(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + VVffoorrkk() can be used to create new processes without fully copying the ad- + dress space of the old process, which is horrendously inefficient in a + paged environment. It is useful when the purpose of fork(2) would have + been to create a new system context for an execve. VVffoorrkk() differs from + fork in that the child borrows the parent's memory and thread of control + until a call to execve(2) or an exit (either by a call to exit(2) or ab- + normally.) The parent process is suspended while the child is using its + resources. + + VVffoorrkk() returns 0 in the child's context and (later) the pid of the child + in the parent's context. + + VVffoorrkk() can normally be used just like fork. It does not work, however, + to return while running in the childs context from the procedure that + called vvffoorrkk() since the eventual return from vvffoorrkk() would then return + to a no longer existent stack frame. Be careful, also, to call _exit + rather than exit if you can't execve, since exit will flush and close + standard I/O channels, and thereby mess up the parent processes standard + I/O data structures. (Even with fork it is wrong to call exit since + buffered data would then be flushed twice.) + +SSEEEE AALLSSOO + fork(2), execve(2), sigvec(2), wait(2), + +DDIIAAGGNNOOSSTTIICCSS + Same as for fork. + +BBUUGGSS + This system call will be eliminated when proper system sharing mechanisms + are implemented. Users should not depend on the memory sharing semantics + of vfork as it will, in that case, be made synonymous to fork. + + To avoid a possible deadlock situation, processes that are children in + the middle of a vvffoorrkk() are never sent SIGTTOU or SIGTTIN signals; + rather, output or ioctl(2) calls are allowed and input attempts result in + an end-of-file indication. + +HHIISSTTOORRYY + The vvffoorrkk function call appeared in 3.0BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat2/wait.0 b/usr/share/man/cat2/wait.0 new file mode 100644 index 0000000000..8bed56c0ec --- /dev/null +++ b/usr/share/man/cat2/wait.0 @@ -0,0 +1,150 @@ +WAIT(2) BSD Programmer's Manual WAIT(2) + +NNAAMMEE + wwaaiitt, wwaaiittppiidd, wwaaiitt44, wwaaiitt33 - wait for process terminatation + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiitt(_i_n_t _*_s_t_a_t_u_s); + + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiittppiidd(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s); + + _p_i_d___t + wwaaiitt33(_i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + + _p_i_d___t + wwaaiitt44(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + +DDEESSCCRRIIPPTTIIOONN + The wwaaiitt() function suspends execution of its calling process until + _s_t_a_t_u_s information is available for a terminated child process, or a sig- + nal is received. On return from a successful wwaaiitt() call, the _s_t_a_t_u_s + area contains termination information about the process that exited as + defined below. + + The wwaaiitt44() call provides a more general interface for programs that need + to wait for certain child processes, that need resource utilization + statistics accummulated by child processes, or that require options. The + other wait functions are implemented using wwaaiitt44(). + + The _w_p_i_d parameter specifies the set of child processes for which to + wait. If _w_p_i_d is -1, the call waits for any child process. If _w_p_i_d is + 0, the call waits for any child process in the process group of the + caller. If _w_p_i_d is greater than zero, the call waits for the process + with process id _w_p_i_d. If _w_p_i_d is less than -1, the call waits for any + process whose process group id equals the absolute value of _w_p_i_d. + + The _s_t_a_t_u_s parameter is defined below. The _o_p_t_i_o_n_s parameter contains + the bitwise OR of any of the following options. The WNOHANG option is + used to indicate that the call should not block if there are no processes + that wish to report status. If the WUNTRACED option is set, children of + the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, + or SIGSTOP signal also have their status reported. + + If _r_u_s_a_g_e is non-zero, a summary of the resources used by the terminated + process and all its children is returned (this information is currently + not available for stopped processes). + + When the WNOHANG option is specified and no processes wish to report sta- + tus, wwaaiitt44() returns a process id of 0. + + The wwaaiittppiidd() call is identical to wwaaiitt44() with an _r_u_s_a_g_e value of zero. + The older wwaaiitt33() call is the same as wwaaiitt44() with a _w_p_i_d value of -1. + + The following macros may be used to test the manner of exit of the pro- + cess. One of the first three macros will evaluate to a non-zero (true) + value: + + WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) + True if the process terminated normally by a call to _exit(2) or + exit(2). + + WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) + True if the process terminated due to receipt of a signal. + + WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) + True if the process has not terminated, but has stopped and can + be restarted. This macro can be true only if the wait call spec- + ified the WUNTRACED option or if the child process is being + traced (see ptrace(2)). + + Depending on the values of those macros, the following macros produce the + remaining status information about the child process: + + WWEEXXIITTSSTTAATTUUSS(_s_t_a_t_u_s) + If WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) is true, evaluates to the low-order 8 bits + of the argument passed to _exit(2) or exit(2) by the child. + + WWTTEERRMMSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the termination of the process. + + WWCCOORREEDDUUMMPP(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates as true if the termina- + tion of the process was accompanied by the creation of a core + file containing an image of the process when the signal was re- + ceived. + + WWSSTTOOPPSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the process to stop. + +NNOOTTEESS + See sigaction(2) for a list of termination signals. A status of 0 indi- + cates normal termination. + + If a parent process terminates without waiting for all of its child pro- + cesses to terminate, the remaining child processes are assigned the par- + ent process 1 ID (the init process ID). + + If a signal is caught while any of the wwaaiitt() calls is pending, the call + may be interrupted or restarted when the signal-catching routine returns, + depending on the options in effect for the signal; see intro(2), System + call restart. + +RREETTUURRNN VVAALLUUEESS + If wwaaiitt() returns due to a stopped or terminated child process, the pro- + cess ID of the child is returned to the calling process. Otherwise, a + value of -1 is returned and _e_r_r_n_o is set to indicate the error. + + If wwaaiitt44(), wwaaiitt33() or wwaaiittppiidd() returns due to a stopped or terminated + child process, the process ID of the child is returned to the calling + process. If there are no children not previously awaited, -1 is returned + with _e_r_r_n_o set to [ECHILD]. Otherwise, if WNOHANG is specified and there + are no stopped or exited children, 0 is returned. If an error is detect- + ed or a caught signal aborts the call, a value of -1 is returned and + _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + WWaaiitt() will fail and return immediately if: + + [ECHILD] The calling process has no existing unwaited-for child pro- + cesses. + + [EFAULT] The _s_t_a_t_u_s or _r_u_s_a_g_e arguments point to an illegal address. + + (May not be detected before exit of a child process.) + + [EINTR] The call was interrupted by a caught signal, or the signal + did not have the SA_RESTART flag set. + +SSTTAANNDDAARRDDSS + The wwaaiitt() and wwaaiittppiidd() functions are defined by POSIX; wwaaiitt44() and + wwaaiitt33() are not specified by POSIX. The WWCCOORREEDDUUMMPP() macro and the abili- + ty to restart a pending wwaaiitt() call are extensions to the POSIX inter- + face. + +SSEEEE AALLSSOO + exit(2), sigaction(2) + +HHIISSTTOORRYY + A wwaaiitt function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/wait3.0 b/usr/share/man/cat2/wait3.0 new file mode 100644 index 0000000000..8bed56c0ec --- /dev/null +++ b/usr/share/man/cat2/wait3.0 @@ -0,0 +1,150 @@ +WAIT(2) BSD Programmer's Manual WAIT(2) + +NNAAMMEE + wwaaiitt, wwaaiittppiidd, wwaaiitt44, wwaaiitt33 - wait for process terminatation + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiitt(_i_n_t _*_s_t_a_t_u_s); + + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiittppiidd(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s); + + _p_i_d___t + wwaaiitt33(_i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + + _p_i_d___t + wwaaiitt44(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + +DDEESSCCRRIIPPTTIIOONN + The wwaaiitt() function suspends execution of its calling process until + _s_t_a_t_u_s information is available for a terminated child process, or a sig- + nal is received. On return from a successful wwaaiitt() call, the _s_t_a_t_u_s + area contains termination information about the process that exited as + defined below. + + The wwaaiitt44() call provides a more general interface for programs that need + to wait for certain child processes, that need resource utilization + statistics accummulated by child processes, or that require options. The + other wait functions are implemented using wwaaiitt44(). + + The _w_p_i_d parameter specifies the set of child processes for which to + wait. If _w_p_i_d is -1, the call waits for any child process. If _w_p_i_d is + 0, the call waits for any child process in the process group of the + caller. If _w_p_i_d is greater than zero, the call waits for the process + with process id _w_p_i_d. If _w_p_i_d is less than -1, the call waits for any + process whose process group id equals the absolute value of _w_p_i_d. + + The _s_t_a_t_u_s parameter is defined below. The _o_p_t_i_o_n_s parameter contains + the bitwise OR of any of the following options. The WNOHANG option is + used to indicate that the call should not block if there are no processes + that wish to report status. If the WUNTRACED option is set, children of + the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, + or SIGSTOP signal also have their status reported. + + If _r_u_s_a_g_e is non-zero, a summary of the resources used by the terminated + process and all its children is returned (this information is currently + not available for stopped processes). + + When the WNOHANG option is specified and no processes wish to report sta- + tus, wwaaiitt44() returns a process id of 0. + + The wwaaiittppiidd() call is identical to wwaaiitt44() with an _r_u_s_a_g_e value of zero. + The older wwaaiitt33() call is the same as wwaaiitt44() with a _w_p_i_d value of -1. + + The following macros may be used to test the manner of exit of the pro- + cess. One of the first three macros will evaluate to a non-zero (true) + value: + + WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) + True if the process terminated normally by a call to _exit(2) or + exit(2). + + WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) + True if the process terminated due to receipt of a signal. + + WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) + True if the process has not terminated, but has stopped and can + be restarted. This macro can be true only if the wait call spec- + ified the WUNTRACED option or if the child process is being + traced (see ptrace(2)). + + Depending on the values of those macros, the following macros produce the + remaining status information about the child process: + + WWEEXXIITTSSTTAATTUUSS(_s_t_a_t_u_s) + If WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) is true, evaluates to the low-order 8 bits + of the argument passed to _exit(2) or exit(2) by the child. + + WWTTEERRMMSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the termination of the process. + + WWCCOORREEDDUUMMPP(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates as true if the termina- + tion of the process was accompanied by the creation of a core + file containing an image of the process when the signal was re- + ceived. + + WWSSTTOOPPSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the process to stop. + +NNOOTTEESS + See sigaction(2) for a list of termination signals. A status of 0 indi- + cates normal termination. + + If a parent process terminates without waiting for all of its child pro- + cesses to terminate, the remaining child processes are assigned the par- + ent process 1 ID (the init process ID). + + If a signal is caught while any of the wwaaiitt() calls is pending, the call + may be interrupted or restarted when the signal-catching routine returns, + depending on the options in effect for the signal; see intro(2), System + call restart. + +RREETTUURRNN VVAALLUUEESS + If wwaaiitt() returns due to a stopped or terminated child process, the pro- + cess ID of the child is returned to the calling process. Otherwise, a + value of -1 is returned and _e_r_r_n_o is set to indicate the error. + + If wwaaiitt44(), wwaaiitt33() or wwaaiittppiidd() returns due to a stopped or terminated + child process, the process ID of the child is returned to the calling + process. If there are no children not previously awaited, -1 is returned + with _e_r_r_n_o set to [ECHILD]. Otherwise, if WNOHANG is specified and there + are no stopped or exited children, 0 is returned. If an error is detect- + ed or a caught signal aborts the call, a value of -1 is returned and + _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + WWaaiitt() will fail and return immediately if: + + [ECHILD] The calling process has no existing unwaited-for child pro- + cesses. + + [EFAULT] The _s_t_a_t_u_s or _r_u_s_a_g_e arguments point to an illegal address. + + (May not be detected before exit of a child process.) + + [EINTR] The call was interrupted by a caught signal, or the signal + did not have the SA_RESTART flag set. + +SSTTAANNDDAARRDDSS + The wwaaiitt() and wwaaiittppiidd() functions are defined by POSIX; wwaaiitt44() and + wwaaiitt33() are not specified by POSIX. The WWCCOORREEDDUUMMPP() macro and the abili- + ty to restart a pending wwaaiitt() call are extensions to the POSIX inter- + face. + +SSEEEE AALLSSOO + exit(2), sigaction(2) + +HHIISSTTOORRYY + A wwaaiitt function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/wait4.0 b/usr/share/man/cat2/wait4.0 new file mode 100644 index 0000000000..8bed56c0ec --- /dev/null +++ b/usr/share/man/cat2/wait4.0 @@ -0,0 +1,150 @@ +WAIT(2) BSD Programmer's Manual WAIT(2) + +NNAAMMEE + wwaaiitt, wwaaiittppiidd, wwaaiitt44, wwaaiitt33 - wait for process terminatation + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiitt(_i_n_t _*_s_t_a_t_u_s); + + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiittppiidd(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s); + + _p_i_d___t + wwaaiitt33(_i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + + _p_i_d___t + wwaaiitt44(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + +DDEESSCCRRIIPPTTIIOONN + The wwaaiitt() function suspends execution of its calling process until + _s_t_a_t_u_s information is available for a terminated child process, or a sig- + nal is received. On return from a successful wwaaiitt() call, the _s_t_a_t_u_s + area contains termination information about the process that exited as + defined below. + + The wwaaiitt44() call provides a more general interface for programs that need + to wait for certain child processes, that need resource utilization + statistics accummulated by child processes, or that require options. The + other wait functions are implemented using wwaaiitt44(). + + The _w_p_i_d parameter specifies the set of child processes for which to + wait. If _w_p_i_d is -1, the call waits for any child process. If _w_p_i_d is + 0, the call waits for any child process in the process group of the + caller. If _w_p_i_d is greater than zero, the call waits for the process + with process id _w_p_i_d. If _w_p_i_d is less than -1, the call waits for any + process whose process group id equals the absolute value of _w_p_i_d. + + The _s_t_a_t_u_s parameter is defined below. The _o_p_t_i_o_n_s parameter contains + the bitwise OR of any of the following options. The WNOHANG option is + used to indicate that the call should not block if there are no processes + that wish to report status. If the WUNTRACED option is set, children of + the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, + or SIGSTOP signal also have their status reported. + + If _r_u_s_a_g_e is non-zero, a summary of the resources used by the terminated + process and all its children is returned (this information is currently + not available for stopped processes). + + When the WNOHANG option is specified and no processes wish to report sta- + tus, wwaaiitt44() returns a process id of 0. + + The wwaaiittppiidd() call is identical to wwaaiitt44() with an _r_u_s_a_g_e value of zero. + The older wwaaiitt33() call is the same as wwaaiitt44() with a _w_p_i_d value of -1. + + The following macros may be used to test the manner of exit of the pro- + cess. One of the first three macros will evaluate to a non-zero (true) + value: + + WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) + True if the process terminated normally by a call to _exit(2) or + exit(2). + + WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) + True if the process terminated due to receipt of a signal. + + WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) + True if the process has not terminated, but has stopped and can + be restarted. This macro can be true only if the wait call spec- + ified the WUNTRACED option or if the child process is being + traced (see ptrace(2)). + + Depending on the values of those macros, the following macros produce the + remaining status information about the child process: + + WWEEXXIITTSSTTAATTUUSS(_s_t_a_t_u_s) + If WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) is true, evaluates to the low-order 8 bits + of the argument passed to _exit(2) or exit(2) by the child. + + WWTTEERRMMSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the termination of the process. + + WWCCOORREEDDUUMMPP(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates as true if the termina- + tion of the process was accompanied by the creation of a core + file containing an image of the process when the signal was re- + ceived. + + WWSSTTOOPPSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the process to stop. + +NNOOTTEESS + See sigaction(2) for a list of termination signals. A status of 0 indi- + cates normal termination. + + If a parent process terminates without waiting for all of its child pro- + cesses to terminate, the remaining child processes are assigned the par- + ent process 1 ID (the init process ID). + + If a signal is caught while any of the wwaaiitt() calls is pending, the call + may be interrupted or restarted when the signal-catching routine returns, + depending on the options in effect for the signal; see intro(2), System + call restart. + +RREETTUURRNN VVAALLUUEESS + If wwaaiitt() returns due to a stopped or terminated child process, the pro- + cess ID of the child is returned to the calling process. Otherwise, a + value of -1 is returned and _e_r_r_n_o is set to indicate the error. + + If wwaaiitt44(), wwaaiitt33() or wwaaiittppiidd() returns due to a stopped or terminated + child process, the process ID of the child is returned to the calling + process. If there are no children not previously awaited, -1 is returned + with _e_r_r_n_o set to [ECHILD]. Otherwise, if WNOHANG is specified and there + are no stopped or exited children, 0 is returned. If an error is detect- + ed or a caught signal aborts the call, a value of -1 is returned and + _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + WWaaiitt() will fail and return immediately if: + + [ECHILD] The calling process has no existing unwaited-for child pro- + cesses. + + [EFAULT] The _s_t_a_t_u_s or _r_u_s_a_g_e arguments point to an illegal address. + + (May not be detected before exit of a child process.) + + [EINTR] The call was interrupted by a caught signal, or the signal + did not have the SA_RESTART flag set. + +SSTTAANNDDAARRDDSS + The wwaaiitt() and wwaaiittppiidd() functions are defined by POSIX; wwaaiitt44() and + wwaaiitt33() are not specified by POSIX. The WWCCOORREEDDUUMMPP() macro and the abili- + ty to restart a pending wwaaiitt() call are extensions to the POSIX inter- + face. + +SSEEEE AALLSSOO + exit(2), sigaction(2) + +HHIISSTTOORRYY + A wwaaiitt function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/waitpid.0 b/usr/share/man/cat2/waitpid.0 new file mode 100644 index 0000000000..8bed56c0ec --- /dev/null +++ b/usr/share/man/cat2/waitpid.0 @@ -0,0 +1,150 @@ +WAIT(2) BSD Programmer's Manual WAIT(2) + +NNAAMMEE + wwaaiitt, wwaaiittppiidd, wwaaiitt44, wwaaiitt33 - wait for process terminatation + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiitt(_i_n_t _*_s_t_a_t_u_s); + + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + wwaaiittppiidd(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s); + + _p_i_d___t + wwaaiitt33(_i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + + _p_i_d___t + wwaaiitt44(_p_i_d___t _w_p_i_d, _i_n_t _*_s_t_a_t_u_s, _i_n_t _o_p_t_i_o_n_s, _s_t_r_u_c_t _r_u_s_a_g_e _*_r_u_s_a_g_e); + +DDEESSCCRRIIPPTTIIOONN + The wwaaiitt() function suspends execution of its calling process until + _s_t_a_t_u_s information is available for a terminated child process, or a sig- + nal is received. On return from a successful wwaaiitt() call, the _s_t_a_t_u_s + area contains termination information about the process that exited as + defined below. + + The wwaaiitt44() call provides a more general interface for programs that need + to wait for certain child processes, that need resource utilization + statistics accummulated by child processes, or that require options. The + other wait functions are implemented using wwaaiitt44(). + + The _w_p_i_d parameter specifies the set of child processes for which to + wait. If _w_p_i_d is -1, the call waits for any child process. If _w_p_i_d is + 0, the call waits for any child process in the process group of the + caller. If _w_p_i_d is greater than zero, the call waits for the process + with process id _w_p_i_d. If _w_p_i_d is less than -1, the call waits for any + process whose process group id equals the absolute value of _w_p_i_d. + + The _s_t_a_t_u_s parameter is defined below. The _o_p_t_i_o_n_s parameter contains + the bitwise OR of any of the following options. The WNOHANG option is + used to indicate that the call should not block if there are no processes + that wish to report status. If the WUNTRACED option is set, children of + the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, + or SIGSTOP signal also have their status reported. + + If _r_u_s_a_g_e is non-zero, a summary of the resources used by the terminated + process and all its children is returned (this information is currently + not available for stopped processes). + + When the WNOHANG option is specified and no processes wish to report sta- + tus, wwaaiitt44() returns a process id of 0. + + The wwaaiittppiidd() call is identical to wwaaiitt44() with an _r_u_s_a_g_e value of zero. + The older wwaaiitt33() call is the same as wwaaiitt44() with a _w_p_i_d value of -1. + + The following macros may be used to test the manner of exit of the pro- + cess. One of the first three macros will evaluate to a non-zero (true) + value: + + WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) + True if the process terminated normally by a call to _exit(2) or + exit(2). + + WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) + True if the process terminated due to receipt of a signal. + + WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) + True if the process has not terminated, but has stopped and can + be restarted. This macro can be true only if the wait call spec- + ified the WUNTRACED option or if the child process is being + traced (see ptrace(2)). + + Depending on the values of those macros, the following macros produce the + remaining status information about the child process: + + WWEEXXIITTSSTTAATTUUSS(_s_t_a_t_u_s) + If WWIIFFEEXXIITTEEDD(_s_t_a_t_u_s) is true, evaluates to the low-order 8 bits + of the argument passed to _exit(2) or exit(2) by the child. + + WWTTEERRMMSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the termination of the process. + + WWCCOORREEDDUUMMPP(_s_t_a_t_u_s) + If WWIIFFSSIIGGNNAALLEEDD(_s_t_a_t_u_s) is true, evaluates as true if the termina- + tion of the process was accompanied by the creation of a core + file containing an image of the process when the signal was re- + ceived. + + WWSSTTOOPPSSIIGG(_s_t_a_t_u_s) + If WWIIFFSSTTOOPPPPEEDD(_s_t_a_t_u_s) is true, evaluates to the number of the + signal that caused the process to stop. + +NNOOTTEESS + See sigaction(2) for a list of termination signals. A status of 0 indi- + cates normal termination. + + If a parent process terminates without waiting for all of its child pro- + cesses to terminate, the remaining child processes are assigned the par- + ent process 1 ID (the init process ID). + + If a signal is caught while any of the wwaaiitt() calls is pending, the call + may be interrupted or restarted when the signal-catching routine returns, + depending on the options in effect for the signal; see intro(2), System + call restart. + +RREETTUURRNN VVAALLUUEESS + If wwaaiitt() returns due to a stopped or terminated child process, the pro- + cess ID of the child is returned to the calling process. Otherwise, a + value of -1 is returned and _e_r_r_n_o is set to indicate the error. + + If wwaaiitt44(), wwaaiitt33() or wwaaiittppiidd() returns due to a stopped or terminated + child process, the process ID of the child is returned to the calling + process. If there are no children not previously awaited, -1 is returned + with _e_r_r_n_o set to [ECHILD]. Otherwise, if WNOHANG is specified and there + are no stopped or exited children, 0 is returned. If an error is detect- + ed or a caught signal aborts the call, a value of -1 is returned and + _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + WWaaiitt() will fail and return immediately if: + + [ECHILD] The calling process has no existing unwaited-for child pro- + cesses. + + [EFAULT] The _s_t_a_t_u_s or _r_u_s_a_g_e arguments point to an illegal address. + + (May not be detected before exit of a child process.) + + [EINTR] The call was interrupted by a caught signal, or the signal + did not have the SA_RESTART flag set. + +SSTTAANNDDAARRDDSS + The wwaaiitt() and wwaaiittppiidd() functions are defined by POSIX; wwaaiitt44() and + wwaaiitt33() are not specified by POSIX. The WWCCOORREEDDUUMMPP() macro and the abili- + ty to restart a pending wwaaiitt() call are extensions to the POSIX inter- + face. + +SSEEEE AALLSSOO + exit(2), sigaction(2) + +HHIISSTTOORRYY + A wwaaiitt function call appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat2/write.0 b/usr/share/man/cat2/write.0 new file mode 100644 index 0000000000..04d2675313 --- /dev/null +++ b/usr/share/man/cat2/write.0 @@ -0,0 +1,107 @@ +WRITE(2) BSD Programmer's Manual WRITE(2) + +NNAAMMEE + wwrriittee, wwrriitteevv - write output + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_s_i_z_e___t + wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _i_n_t + wwrriitteevv(_i_n_t _d, _s_t_r_u_c_t _i_o_v_e_c _*_i_o_v, _i_n_t _i_o_v_c_n_t); + +DDEESSCCRRIIPPTTIIOONN + WWrriittee() attempts to write _n_b_y_t_e_s of data to the object referenced by the + descriptor _d from the buffer pointed to by _b_u_f. WWrriitteevv() performs the + same action, but gathers the output data from the _i_o_v_c_n_t buffers speci- + fied by the members of the _i_o_v array: iov[0], iov[1], ..., iov[iovcnt-1]. + + For wwrriitteevv(), the _i_o_v_e_c structure is defined as: + struct iovec { + void *iov_base; + int iov_len; + }; + + Each _i_o_v_e_c entry specifies the base address and length of an area in mem- + ory from which data should be written. WWrriitteevv() will always write a com- + plete area before proceeding to the next. + + On objects capable of seeking, the wwrriittee() starts at a position given by + the pointer associated with _d, see lseek(2). Upon return from wwrriittee(), + the pointer is incremented by the number of bytes which were written. + + Objects that are not capable of seeking always write from the current po- + sition. The value of the pointer associated with such an object is unde- + fined. + + If the real user is not the super-user, then wwrriittee() clears the set-user- + id bit on a file. This prevents penetration of system security by a user + who ``captures'' a writable set-user-id file owned by the super-user. + + When using non-blocking I/O on objects such as sockets that are subject + to flow control, wwrriittee() and wwrriitteevv() may write fewer bytes than request- + ed; the return value must be noted, and the remainder of the operation + should be retried when possible. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion the number of bytes which were written is re- + turned. Otherwise a -1 is returned and the global variable _e_r_r_n_o is set + to indicate the error. + +EERRRROORRSS + WWrriittee() and wwrriitteevv() will fail and the file pointer will remain unchanged + if: + + [EBADF] _D is not a valid descriptor open for writing. + + [EPIPE] An attempt is made to write to a pipe that is not open for + reading by any process. + + [EPIPE] An attempt is made to write to a socket of type that is not + + connected to a peer socket. + + [EFBIG] An attempt was made to write a file that exceeds the pro- + cess's file size limit or the maximum file size. + + [EFAULT] Part of _i_o_v or data to be written to the file points out- + side the process's allocated address space. + + [EINVAL] The pointer associated with _d was negative. + + [ENOSPC] There is no free space remaining on the file system con- + taining the file. + + [EDQUOT] The user's quota of disk blocks on the file system contain- + ing the file has been exhausted. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + [EAGAIN] The file was marked for non-blocking I/O, and no data could + be written immediately. + + In addition, wwrriitteevv() may return one of the following errors: + + [EINVAL] _I_o_v_c_n_t was less than or equal to 0, or greater than 16. + + [EINVAL] One of the _i_o_v___l_e_n values in the _i_o_v array was negative. + + [EINVAL] The sum of the _i_o_v___l_e_n values in the _i_o_v array overflowed a + 32-bit integer. + +SSEEEE AALLSSOO + fcntl(2), lseek(2), open(2), pipe(2), select(2) + +SSTTAANNDDAARRDDSS + WWrriittee() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The wwrriitteevv() function call appeared in 4.2BSD. A wwrriittee function call ap- + peared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat2/writev.0 b/usr/share/man/cat2/writev.0 new file mode 100644 index 0000000000..04d2675313 --- /dev/null +++ b/usr/share/man/cat2/writev.0 @@ -0,0 +1,107 @@ +WRITE(2) BSD Programmer's Manual WRITE(2) + +NNAAMMEE + wwrriittee, wwrriitteevv - write output + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_s_i_z_e___t + wwrriittee(_i_n_t _d, _c_o_n_s_t _v_o_i_d _*_b_u_f, _s_i_z_e___t _n_b_y_t_e_s); + + _i_n_t + wwrriitteevv(_i_n_t _d, _s_t_r_u_c_t _i_o_v_e_c _*_i_o_v, _i_n_t _i_o_v_c_n_t); + +DDEESSCCRRIIPPTTIIOONN + WWrriittee() attempts to write _n_b_y_t_e_s of data to the object referenced by the + descriptor _d from the buffer pointed to by _b_u_f. WWrriitteevv() performs the + same action, but gathers the output data from the _i_o_v_c_n_t buffers speci- + fied by the members of the _i_o_v array: iov[0], iov[1], ..., iov[iovcnt-1]. + + For wwrriitteevv(), the _i_o_v_e_c structure is defined as: + struct iovec { + void *iov_base; + int iov_len; + }; + + Each _i_o_v_e_c entry specifies the base address and length of an area in mem- + ory from which data should be written. WWrriitteevv() will always write a com- + plete area before proceeding to the next. + + On objects capable of seeking, the wwrriittee() starts at a position given by + the pointer associated with _d, see lseek(2). Upon return from wwrriittee(), + the pointer is incremented by the number of bytes which were written. + + Objects that are not capable of seeking always write from the current po- + sition. The value of the pointer associated with such an object is unde- + fined. + + If the real user is not the super-user, then wwrriittee() clears the set-user- + id bit on a file. This prevents penetration of system security by a user + who ``captures'' a writable set-user-id file owned by the super-user. + + When using non-blocking I/O on objects such as sockets that are subject + to flow control, wwrriittee() and wwrriitteevv() may write fewer bytes than request- + ed; the return value must be noted, and the remainder of the operation + should be retried when possible. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion the number of bytes which were written is re- + turned. Otherwise a -1 is returned and the global variable _e_r_r_n_o is set + to indicate the error. + +EERRRROORRSS + WWrriittee() and wwrriitteevv() will fail and the file pointer will remain unchanged + if: + + [EBADF] _D is not a valid descriptor open for writing. + + [EPIPE] An attempt is made to write to a pipe that is not open for + reading by any process. + + [EPIPE] An attempt is made to write to a socket of type that is not + + connected to a peer socket. + + [EFBIG] An attempt was made to write a file that exceeds the pro- + cess's file size limit or the maximum file size. + + [EFAULT] Part of _i_o_v or data to be written to the file points out- + side the process's allocated address space. + + [EINVAL] The pointer associated with _d was negative. + + [ENOSPC] There is no free space remaining on the file system con- + taining the file. + + [EDQUOT] The user's quota of disk blocks on the file system contain- + ing the file has been exhausted. + + [EIO] An I/O error occurred while reading from or writing to the + file system. + + [EAGAIN] The file was marked for non-blocking I/O, and no data could + be written immediately. + + In addition, wwrriitteevv() may return one of the following errors: + + [EINVAL] _I_o_v_c_n_t was less than or equal to 0, or greater than 16. + + [EINVAL] One of the _i_o_v___l_e_n values in the _i_o_v array was negative. + + [EINVAL] The sum of the _i_o_v___l_e_n values in the _i_o_v array overflowed a + 32-bit integer. + +SSEEEE AALLSSOO + fcntl(2), lseek(2), open(2), pipe(2), select(2) + +SSTTAANNDDAARRDDSS + WWrriittee() is expected to conform to IEEE Std 1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The wwrriitteevv() function call appeared in 4.2BSD. A wwrriittee function call ap- + peared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/_longjmp.0 b/usr/share/man/cat3/_longjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/_longjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/_setjmp.0 b/usr/share/man/cat3/_setjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/_setjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/abort.0 b/usr/share/man/cat3/abort.0 new file mode 100644 index 0000000000..30fd9450c1 --- /dev/null +++ b/usr/share/man/cat3/abort.0 @@ -0,0 +1,28 @@ +ABORT(3) BSD Programmer's Manual ABORT(3) + +NNAAMMEE + aabboorrtt - cause abnormal program termination + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + aabboorrtt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The aabboorrtt() function causes abnormal program termination to occur, unless + the signal SIGABRT is being caught and the signal handler does not re- + turn. + + No open streams are closed or flushed. + +RREETTUURRNN VVAALLUUEESS + The aabboorrtt function never returns. + +SSEEEE AALLSSOO + sigaction(2), exit(2) + +SSTTAANNDDAARRDDSS + The aabboorrtt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/abs.0 b/usr/share/man/cat3/abs.0 new file mode 100644 index 0000000000..be7f2fa3f9 --- /dev/null +++ b/usr/share/man/cat3/abs.0 @@ -0,0 +1,27 @@ +ABS(3) BSD Programmer's Manual ABS(3) + +NNAAMMEE + aabbss - integer absolute value function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aabbss(_i_n_t _j); + +DDEESSCCRRIIPPTTIIOONN + The aabbss() function computes the absolute value of the integer _j. + +RREETTUURRNN VVAALLUUEESS + The aabbss() function returns the absolute value. + +SSEEEE AALLSSOO + floor(3), labs(3) cabs(3) hypot(3) math(3) + +SSTTAANNDDAARRDDSS + The aabbss() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + The absolute value of the most negative integer remains negative. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/addr.0 b/usr/share/man/cat3/addr.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/addr.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/alarm.0 b/usr/share/man/cat3/alarm.0 new file mode 100644 index 0000000000..c4cd93a796 --- /dev/null +++ b/usr/share/man/cat3/alarm.0 @@ -0,0 +1,30 @@ +ALARM(3) BSD Programmer's Manual ALARM(3) + +NNAAMMEE + aallaarrmm - set signal timer alarm + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___i_n_t + aallaarrmm(_u___i_n_t _s_e_c_o_n_d_s); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy sseettiittiimmeerr((22)).. + + The aallaarrmm() function waits a count of _s_e_c_o_n_d_s before asserting the termi- + nating signal SIGALRM. When the signal has successfully been caught, + aallaarrmm() returns the amount of time left on the clock. The maximum mumber + of _s_e_c_o_n_d_s allowed is 2147483647. + + If an alarm has been set with aallaarrmm(), another call to aallaarrmm() will su- + perceed the prior call. The request aallaarrmm(_0) voids the current alarm. + +SSEEEE AALLSSOO + sigaction(2), setitimer(2), sigpause(2), sigvec(2), signal(3), + sleep(3), ualarm(3), usleep(3) + +HHIISSTTOORRYY + An aallaarrmm() function appeared in Version 7 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/alloca.0 b/usr/share/man/cat3/alloca.0 new file mode 100644 index 0000000000..d2aa3aeed9 --- /dev/null +++ b/usr/share/man/cat3/alloca.0 @@ -0,0 +1,26 @@ +ALLOCA(3) BSD Programmer's Manual ALLOCA(3) + +NNAAMMEE + aallllooccaa - memory allocator + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + aallllooccaa(_s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The aallllooccaa() function allocates _s_i_z_e bytes of space in the stack frame of + the caller. This temporary space is automatically freed on return. + +RREETTUURRNN VVAALLUUEESS + The aallllooccaa() function returns a pointer to the beginning of the allocated + space. If the allocation failed, a NULL pointer is returned. + +SSEEEE AALLSSOO + brk(2), pagesize(2) calloc(3), malloc(3), realloc(3), + +BBUUGGSS + The aallllooccaa() function is machine dependent; its use is discouraged. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/alphasort.0 b/usr/share/man/cat3/alphasort.0 new file mode 100644 index 0000000000..c0281fb82d --- /dev/null +++ b/usr/share/man/cat3/alphasort.0 @@ -0,0 +1,51 @@ +SCANDIR(3) BSD Programmer's Manual SCANDIR(3) + +NNAAMMEE + ssccaannddiirr, aallpphhaassoorrtt - scan a directory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssccaannddiirr(_c_o_n_s_t _c_h_a_r _*_d_i_r_n_a_m_e, _s_t_r_u_c_t _d_i_r_e_n_t _*_*_*_n_a_m_e_l_i_s_t, + _i_n_t (_*_s_e_l_e_c_t)(_s_t_r_u_c_t _d_i_r_e_n_t _*), + _i_n_t (_*_c_o_m_p_a_r)(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*)); + + _i_n_t + aallpphhaassoorrtt(_c_o_n_s_t _v_o_i_d _*_d_1, _c_o_n_s_t _v_o_i_d _*_d_2); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannddiirr() function reads the directory _d_i_r_n_a_m_e and builds an array of + pointers to directory entries using malloc(3). It returns the number of + entries in the array. A pointer to the array of directory entries is + stored in the location referenced by _n_a_m_e_l_i_s_t. + + The _s_e_l_e_c_t parameter is a pointer to a user supplied subroutine which is + called by ssccaannddiirr() to select which entries are to be included in the ar- + ray. The select routine is passed a pointer to a directory entry and + should return a non-zero value if the directory entry is to be included + in the array. If _s_e_l_e_c_t is null, then all the directory entries will be + included. + + The _c_o_m_p_a_r parameter is a pointer to a user supplied subroutine which is + passed to qsort(3) to sort the completed array. If this pointer is null, + the array is not sorted. + + The aallpphhaassoorrtt() function is a routine which can be used for the _c_o_m_p_a_r + parameter to sort the array alphabetically. + + The memory allocated for the array can be deallocated with free(3), by + freeing each pointer in the array and then the array itself. + +DDIIAAGGNNOOSSTTIICCSS + Returns -1 if the directory cannot be opened for reading or if malloc(3) + cannot allocate enough memory to hold all the data structures. + +SSEEEE AALLSSOO + directory(3), malloc(3), qsort(3), dir(5) + +HHIISSTTOORRYY + The ssccaannddiirr() and aallpphhaassoorrtt() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/asctime.0 b/usr/share/man/cat3/asctime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/asctime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/atexit.0 b/usr/share/man/cat3/atexit.0 new file mode 100644 index 0000000000..42a6ef025e --- /dev/null +++ b/usr/share/man/cat3/atexit.0 @@ -0,0 +1,34 @@ +ATEXIT(3) BSD Programmer's Manual ATEXIT(3) + +NNAAMMEE + aatteexxiitt - register a function to be called on exit + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aatteexxiitt(_v_o_i_d _(_*_f_u_n_c_t_i_o_n_)_(_v_o_i_d_)); + +DDEESSCCRRIIPPTTIIOONN + The aatteexxiitt() function registers the given _f_u_n_c_t_i_o_n to be called at pro- + gram exit, whether via exit(3) or via return from the program's _m_a_i_n. + Functions so registered are called in reverse order; no arguments are + passed. At least 32 functions can always be registered, and more are al- + lowed as long as sufficient memory can be allocated. + +RREETTUURRNN VVAALLUUEESS + The aatteexxiitt() function returns the value 0 if successful; otherwise the + value -1 is returned and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + [ENOMEM] No memory was available to add the function to the list. The + existing list of functions is unmodified. + +SSEEEE AALLSSOO + exit(3) + +SSTTAANNDDAARRDDSS + The aatteexxiitt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/atof.0 b/usr/share/man/cat3/atof.0 new file mode 100644 index 0000000000..40440bb182 --- /dev/null +++ b/usr/share/man/cat3/atof.0 @@ -0,0 +1,36 @@ +ATOF(3) BSD Programmer's Manual ATOF(3) + +NNAAMMEE + aattooff - convert ASCII string to double + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + aattooff(_c_o_n_s_t _c_h_a_r _*_n_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The aattooff() function converts the initial portion of the string pointed to + by _n_p_t_r to _d_o_u_b_l_e representation. + + It is equivalent to: + + strtod(nptr, (char **)NULL); + +SSEEEE AALLSSOO + atoi(3), atol(3), strtod(3), strtol(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The aattooff() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + This manual page represents intent instead of actual practice. While it + is intended that aattooff() be implemented using strtod(3), this has not yet + happened. In the current system, aattooff() translates a string in the fol- + lowing form to a double: a string of leading white space, possibly fol- + lowed by a sign (``+'' or ``-''), followed by a digit string which may + contain one decimal point (``.''), which may be followed by either of the + exponent flags (``E'' or ``e''), and lastly, followed by a signed or un- + signed integer. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/atoi.0 b/usr/share/man/cat3/atoi.0 new file mode 100644 index 0000000000..0765a9fc95 --- /dev/null +++ b/usr/share/man/cat3/atoi.0 @@ -0,0 +1,26 @@ +ATOI(3) BSD Programmer's Manual ATOI(3) + +NNAAMMEE + aattooii - convert ASCII string to integer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + aattooii(_c_o_n_s_t _c_h_a_r _*_n_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The aattooii() function converts the initial portion of the string pointed to + by _n_p_t_r to _i_n_t_e_g_e_r representation. + + It is equivalent to: + + (int)strtol(nptr, (char **)NULL, 10); + +SSEEEE AALLSSOO + atof(3), atol(3), strtod(3), strtol(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The aattooii() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/atol.0 b/usr/share/man/cat3/atol.0 new file mode 100644 index 0000000000..32f271d835 --- /dev/null +++ b/usr/share/man/cat3/atol.0 @@ -0,0 +1,26 @@ +ATOL(3) BSD Programmer's Manual ATOL(3) + +NNAAMMEE + aattooll - convert ASCII string to long integer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + aattooll(_c_o_n_s_t _c_h_a_r _*_n_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The aattooll() function converts the initial portion of the string pointed to + by _n_p_t_r to _l_o_n_g _i_n_t_e_g_e_r representation. + + It is equivalent to: + + strtol(nptr, (char **)NULL, 10); + +SSEEEE AALLSSOO + atof(3), atoi(3), strtod(3), strtol(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The aattooll() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/bcmp.0 b/usr/share/man/cat3/bcmp.0 new file mode 100644 index 0000000000..684efdf72c --- /dev/null +++ b/usr/share/man/cat3/bcmp.0 @@ -0,0 +1,25 @@ +BCMP(3) BSD Programmer's Manual BCMP(3) + +NNAAMMEE + bbccmmpp - compare byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + bbccmmpp(_c_o_n_s_t _v_o_i_d _*_b_1, _c_o_n_s_t _v_o_i_d _*_b_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The bbccmmpp() function compares byte string _b_1 against byte string _b_2, re- + turning zero if they are identical, non-zero otherwise. Both strings are + assumed to be _l_e_n bytes long. Zero-length strings are always identical. + + The strings may overlap. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3) + +HHIISSTTOORRYY + A bbccmmpp() function first appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/bcopy.0 b/usr/share/man/cat3/bcopy.0 new file mode 100644 index 0000000000..acb5e03333 --- /dev/null +++ b/usr/share/man/cat3/bcopy.0 @@ -0,0 +1,22 @@ +BCOPY(3) BSD Programmer's Manual BCOPY(3) + +NNAAMMEE + bbccooppyy - copy byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + bbccooppyy(_c_o_n_s_t _v_o_i_d _*_s_r_c, _v_o_i_d _*_d_s_t, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The bbccooppyy() function copies _l_e_n bytes from string _s_r_c to string _d_s_t. The + two strings may overlap. If _l_e_n is zero, no bytes are copied. + +SSEEEE AALLSSOO + memccpy(3), memcpy(3), memmove(3), strcpy(3), strncpy(3) + +HHIISSTTOORRYY + A bbccooppyy() function appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/bsearch.0 b/usr/share/man/cat3/bsearch.0 new file mode 100644 index 0000000000..a36c397280 --- /dev/null +++ b/usr/share/man/cat3/bsearch.0 @@ -0,0 +1,37 @@ +BSEARCH(3) BSD Programmer's Manual BSEARCH(3) + +NNAAMMEE + bbsseeaarrcchh - binary search of a sorted table + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + bbsseeaarrcchh(_c_o_n_s_t _v_o_i_d _*_k_e_y, _c_o_n_s_t _v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_) _(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + +DDEESSCCRRIIPPTTIIOONN + The bbsseeaarrcchh() function searches an array of _n_m_e_m_b objects, the inital + member of which is pointed to by _b_a_s_e, for a member that matches the ob- + ject pointed to by _k_e_y. The size of each member of the array is specified + by _s_i_z_e. + + The contents of the array should be in ascending sorted order according + to the comparison function referenced by _c_o_m_p_a_r. The _c_o_m_p_a_r routine is + expected to have two two arguments which point to the _k_e_y object and to + an array member, in that order, and should return an integer less than, + equal to, or greater than zero if the _k_e_y object is found, respectively, + to be less than, to match, or be greater than the array member. + +RREETTUURRNN VVAALLUUEESS + The bbsseeaarrcchh() function returns a pointer to a matching member of the ar- + ray, or a null pointer if no match is found. If two members compare as + equal, which member is matched is unspecified. + +SSEEEE AALLSSOO + db(3), lsearch(3), qsort(3), + +SSTTAANNDDAARRDDSS + The bbsseeaarrcchh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/bstring.0 b/usr/share/man/cat3/bstring.0 new file mode 100644 index 0000000000..9e61da499b --- /dev/null +++ b/usr/share/man/cat3/bstring.0 @@ -0,0 +1,55 @@ +BSTRING(3) BSD Programmer's Manual BSTRING(3) + +NNAAMMEE + bbccmmpp, bbccooppyy, bbzzeerroo, mmeemmccccppyy, mmeemmcchhrr, mmeemmccmmpp, mmeemmccppyy, mmeemmmmoovvee,, mmeemmsseett - + byte string operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + bbccmmpp(_c_o_n_s_t _v_o_i_d _*_b_1, _c_o_n_s_t _v_o_i_d _*_b_2, _s_i_z_e___t _l_e_n); + + _v_o_i_d + bbccooppyy(_c_o_n_s_t _v_o_i_d _*_s_r_c, _v_o_i_d _*_d_s_t, _s_i_z_e___t _l_e_n); + + _v_o_i_d + bbzzeerroo(_v_o_i_d _*_b, _s_i_z_e___t _l_e_n); + + _v_o_i_d _* + mmeemmcchhrr(_c_o_n_s_t _v_o_i_d _*_b, _i_n_t _c, _s_i_z_e___t _l_e_n); + + _i_n_t + mmeemmccmmpp(_c_o_n_s_t _v_o_i_d _*_b_1, _c_o_n_s_t _v_o_i_d _*_b_2, _s_i_z_e___t _l_e_n); + + _v_o_i_d _* + mmeemmccccppyy(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _i_n_t _c, _s_i_z_e___t _l_e_n); + + _v_o_i_d _* + mmeemmccppyy(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _s_i_z_e___t _l_e_n); + + _v_o_i_d _* + mmeemmmmoovvee(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _s_i_z_e___t _l_e_n); + + _v_o_i_d _* + mmeemmsseett(_v_o_i_d _*_b, _i_n_t _c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on variable length strings of bytes. They do not + check for terminating null bytes as the routines listed in string(3) do. + + See the specific manual pages for more information. + +SSEEEE AALLSSOO + bcmp(3), bcopy(3), bzero(3), memccpy(3), memchr(3), memcmp(3), + memcpy(3), memmove(3), memset(3) + +SSTTAANNDDAARRDDSS + The functions mmeemmcchhrr(), mmeemmccmmpp(), mmeemmccppyy(), mmeemmmmoovvee(), and mmeemmsseett() con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions bbzzeerroo() and mmeemmccccppyy() appeared in 4.3BSD; the functions + bbccmmpp(), bbccooppyy(), appeared in 4.2BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/btree.0 b/usr/share/man/cat3/btree.0 new file mode 100644 index 0000000000..03ab0a7226 --- /dev/null +++ b/usr/share/man/cat3/btree.0 @@ -0,0 +1,264 @@ + + + +BTREE(3) BSD Programmer's Manual BTREE(3) + + +NNAAMMEE + btree - btree database access method + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + +DDEESSCCRRIIPPTTIIOONN + The routine _d_b_o_p_e_n 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 _d_b_o_p_e_n(3), this manual page describes only the btree + specific information. + + The btree data structure is a sorted, balanced tree struc- + ture storing associated key/data pairs. + + The btree access method specific data structure provided + to _d_b_o_p_e_n is defined in the include file as fol- + lows: + + typedef struct { + u_long flags; + u_int cachesize; + int maxkeypage; + int minkeypage; + int psize; + int (*compare)(const DBT *key1, const DBT *key2); + int (*prefix)(const DBT *key1, const DBT *key2); + int lorder; + } BTREEINFO; + + The elements of this structure are as follows: + + flags The flag value is specified by _o_r'ing any of the + following values: + + R_DUP Permit duplicate keys in the tree, i.e. per- + mit insertion if the key to be inserted + already exists in the tree. The default + behavior, as described in _d_b_o_p_e_n(3), is to + overwrite a matching key when inserting a + new key or to fail if the R_NOOVERWRITE flag + is specified. The R_DUP flag is overridden + by the R_NOOVERWRITE flag, and if the + R_NOOVERWRITE flag is specified, attempts to + insert duplicate keys into the tree will + fail. + + If the database contains duplicate keys, the + order of retrieval of key/data pairs is + + + +4.4BSD July 19, 1993 1 + + + + + + + + +BTREE(3) BSD Programmer's Manual BTREE(3) + + + undefined if the _g_e_t routine is used, how- + ever, _s_e_q routine calls with the R_CURSOR + flag set will always return the logical + ``first'' of any group of duplicate keys. + + cachesize + A suggested maximum size (in bytes) of the memory + cache. This value is oonnllyy 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 substan- + tially improves access time. In addition, physical + writes are delayed as long as possible, so a moder- + ate 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 _c_a_c_h_e_s_i_z_e is 0 (no size is + specified) a default cache is used. + + 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 + _p_s_i_z_e is 0 (no page size is specified) a page size + is chosen based on the underlying file system I/O + block size. + + 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 _l_o_r_d_e_r is 0 (no order is + specified) the current host order is used. + + maxkeypage + Not currently used. + + 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, i.e. + 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 _m_i_n_k_e_y_p_a_g_e is 0 (no minimum number of keys is + specified) a value of 2 is used. + + 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 + + + +4.4BSD July 19, 1993 2 + + + + + + + + +BTREE(3) BSD Programmer's Manual BTREE(3) + + + than the second key argument. The same comparison + function must be used on a given tree every time it + is opened. If _c_o_m_p_a_r_e is NULL (no comparison func- + tion is specified), the keys are compared lexi- + cally, with shorter keys considered less than + longer keys. + + prefix Prefix is the prefix comparison function. If spec- + ified, 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 _p_r_e_f_i_x is NULL (no prefix + function is specified), aanndd no comparison function + is specified, a default lexical comparison routine + is used. If _p_r_e_f_i_x is NULL and a comparison rou- + tine is specified, no prefix comparison is done. + + If the file already exists (and the O_TRUNC flag is not + specified), the values specified for the parameters flags, + lorder and psize are ignored in favor of the values used + when the tree was created. + + Forward sequential scans of a tree are from the least key + to the greatest. + + 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. + + 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 modi- + fied to make ordered insertion the best case, resulting in + a much better than normal page fill factor. + +SSEEEE AALLSSOO + _d_b_o_p_e_n(3), _h_a_s_h(3), _m_p_o_o_l(3), _r_e_c_n_o(3) + + _T_h_e _U_b_i_q_u_i_t_o_u_s _B_-_t_r_e_e, Douglas Comer, ACM Comput. Surv. + 11, 2 (June 1979), 121-138. + + _P_r_e_f_i_x _B_-_t_r_e_e_s, Bayer and Unterauer, ACM Transactions on + Database Systems, Vol. 2, 1 (March 1977), 11-26. + + + +4.4BSD July 19, 1993 3 + + + + + + + + +BTREE(3) BSD Programmer's Manual BTREE(3) + + + _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g _V_o_l_. _3_: _S_o_r_t_i_n_g _a_n_d + _S_e_a_r_c_h_i_n_g, D.E. Knuth, 1968, pp 471-480. + +BBUUGGSS + Only big and little endian byte order is supported. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4.4BSD July 19, 1993 4 + + + + + diff --git a/usr/share/man/cat3/byteorder.0 b/usr/share/man/cat3/byteorder.0 new file mode 100644 index 0000000000..a147b31181 --- /dev/null +++ b/usr/share/man/cat3/byteorder.0 @@ -0,0 +1,40 @@ +BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) + +NNAAMMEE + hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte + order + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___l_o_n_g + hhttoonnll(_u___l_o_n_g _h_o_s_t_l_o_n_g); + + _u___s_h_o_r_t + hhttoonnss(_u___s_h_o_r_t _h_o_s_t_s_h_o_r_t); + + _u___l_o_n_g + nnttoohhll(_u___l_o_n_g _n_e_t_l_o_n_g); + + _u___s_h_o_r_t + nnttoohhss(_u___s_h_o_r_t _n_e_t_s_h_o_r_t); + +DDEESSCCRRIIPPTTIIOONN + These routines convert 16 and 32 bit quantities between network byte or- + der and host byte order. On machines which have a byte order which is + the same as the network order, routines are defined as null macros. + + These routines are most often used in conjunction with Internet addresses + and ports as returned by gethostbyname(3) and getservent(3). + +SSEEEE AALLSSOO + gethostbyname(3), getservent(3) + +HHIISSTTOORRYY + The bbyytteeoorrddeerr functions appeared in 4.2BSD. + +BBUUGGSS + On the VAX bytes are handled backwards from most everyone else in the + world. This is not expected to be fixed in the near future. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/bzero.0 b/usr/share/man/cat3/bzero.0 new file mode 100644 index 0000000000..99fd5f869f --- /dev/null +++ b/usr/share/man/cat3/bzero.0 @@ -0,0 +1,22 @@ +BZERO(3) BSD Programmer's Manual BZERO(3) + +NNAAMMEE + bbzzeerroo - write zeroes to a byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + bbzzeerroo(_v_o_i_d _*_b, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The bbzzeerroo() function writes _l_e_n zero bytes to the string _b. If _l_e_n is ze- + ro, bbzzeerroo() does nothing. + +SSEEEE AALLSSOO + memset(3), swab(3) + +HHIISSTTOORRYY + A bbzzeerroo() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/calloc.0 b/usr/share/man/cat3/calloc.0 new file mode 100644 index 0000000000..4b2458f8e0 --- /dev/null +++ b/usr/share/man/cat3/calloc.0 @@ -0,0 +1,26 @@ +CALLOC(3) BSD Programmer's Manual CALLOC(3) + +NNAAMMEE + ccaalllloocc - allocate clean memory (zero initialized space) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + ccaalllloocc(_s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The ccaalllloocc() function allocates space for an array of _n_m_e_m_b objects, each + of whose size is _s_i_z_e. The space is initialized to all bits zero. + +RREETTUURRNN VVAALLUUEESS + The ccaalllloocc() function returns a pointer to the the allocated space if + successful; otherwise a null pointer is returned. + +SSEEEE AALLSSOO + malloc(3), realloc(3), free(3), + +SSTTAANNDDAARRDDSS + The ccaalllloocc() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/cfgetispeed.0 b/usr/share/man/cat3/cfgetispeed.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfgetispeed.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cfgetospeed.0 b/usr/share/man/cat3/cfgetospeed.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfgetospeed.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cfmakeraw.0 b/usr/share/man/cat3/cfmakeraw.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfmakeraw.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cfsetispeed.0 b/usr/share/man/cat3/cfsetispeed.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfsetispeed.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cfsetospeed.0 b/usr/share/man/cat3/cfsetospeed.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfsetospeed.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cfsetspeed.0 b/usr/share/man/cat3/cfsetspeed.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/cfsetspeed.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/cgetcap.0 b/usr/share/man/cat3/cgetcap.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetcap.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetclose.0 b/usr/share/man/cat3/cgetclose.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetclose.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetent.0 b/usr/share/man/cat3/cgetent.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetent.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetfirst.0 b/usr/share/man/cat3/cgetfirst.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetfirst.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetmatch.0 b/usr/share/man/cat3/cgetmatch.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetmatch.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetnext.0 b/usr/share/man/cat3/cgetnext.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetnext.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetnum.0 b/usr/share/man/cat3/cgetnum.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetnum.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetset.0 b/usr/share/man/cat3/cgetset.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetset.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetstr.0 b/usr/share/man/cat3/cgetstr.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetstr.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/cgetustr.0 b/usr/share/man/cat3/cgetustr.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/cgetustr.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/clearerr.0 b/usr/share/man/cat3/clearerr.0 new file mode 100644 index 0000000000..d9b2860109 --- /dev/null +++ b/usr/share/man/cat3/clearerr.0 @@ -0,0 +1,47 @@ +FERROR(3) BSD Programmer's Manual FERROR(3) + +NNAAMMEE + cclleeaarreerrrr, ffeeooff, ffeerrrroorr, ffiilleennoo - check and reset stream status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + cclleeaarreerrrr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeeooff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeerrrroorr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffiilleennoo(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function cclleeaarreerrrr() clears the end-of-file and error indicators for + the stream pointed to by _s_t_r_e_a_m. + + The function ffeeooff() tests the end-of-file indicator for the stream point- + ed to by _s_t_r_e_a_m, returning non-zero if it is set. The end-of-file indi- + cator can only be cleared by the function cclleeaarreerrrr(). + + The function ffeerrrroorr() tests the error indicator for the stream pointed to + by _s_t_r_e_a_m, returning non-zero if it is set. The error indicator can only + be reset by the cclleeaarreerrrr() function. + + The function ffiilleennoo() examines the argument _s_t_r_e_a_m and returns its inte- + ger desciptor. + +EERRRROORRSS + These functions should not fail and do not set the external variable + _e_r_r_n_o. + +SSEEEE AALLSSOO + open(2), stdio(3) + +SSTTAANNDDAARRDDSS + The functions cclleeaarreerrrr(), ffeeooff(), and ffeerrrroorr() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/clock.0 b/usr/share/man/cat3/clock.0 new file mode 100644 index 0000000000..c5903948c6 --- /dev/null +++ b/usr/share/man/cat3/clock.0 @@ -0,0 +1,26 @@ +CLOCK(3) BSD Programmer's Manual CLOCK(3) + +NNAAMMEE + cclloocckk - determine processor time used + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_l_o_c_k___t + cclloocckk(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The cclloocckk() function determines the amount of processor time used since + the invocation of the calling process, measured in CLK_TCKs. + +RREETTUURRNN VVAALLUUEESS + The cclloocckk() function returns the amount of time used unless an error oc- + curs, in which case the return value is -1. + +SSEEEE AALLSSOO + getrusage(2) + +SSTTAANNDDAARRDDSS + The cclloocckk() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/closedir.0 b/usr/share/man/cat3/closedir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/closedir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/closelog.0 b/usr/share/man/cat3/closelog.0 new file mode 100644 index 0000000000..cbcb3a15d5 --- /dev/null +++ b/usr/share/man/cat3/closelog.0 @@ -0,0 +1,150 @@ +SYSLOG(3) BSD Programmer's Manual SYSLOG(3) + +NNAAMMEE + ssyysslloogg, vvssyysslloogg, ooppeennlloogg, cclloosseelloogg, sseettllooggmmaasskk - control system log + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + ssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _._._.); + + _v_o_i_d + vvssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + ooppeennlloogg(_c_o_n_s_t _c_h_a_r _*_i_d_e_n_t, _i_n_t _l_o_g_o_p_t, _i_n_t _f_a_c_i_l_i_t_y); + + _v_o_i_d + cclloosseelloogg(_v_o_i_d); + + _i_n_t + sseettllooggmmaasskk(_i_n_t _m_a_s_k_p_r_i); + +DDEESSCCRRIIPPTTIIOONN + The ssyysslloogg() function writes _m_e_s_s_a_g_e to the system message logger. The + message is then written to the system console, log files, logged-in + users, or forwarded to other machines as appropriate. (See syslogd(8).) + + The message is identical to a printf(3) format string, except that `%m' + is replaced by the current error message. (As denoted by the global vari- + able _e_r_r_n_o; see strerror(3).) A trailing newline is added if none is + present. + + The vvssyysslloogg() function is an alternate form in which the arguments have + already been captured using the variable-length argument facilities of + varargs(3). + + The message is tagged with _p_r_i_o_r_i_t_y. Priorities are encoded as a _f_a_c_i_l_i_t_y + and a _l_e_v_e_l. The facility describes the part of the system generating the + message. The level is selected from the following _o_r_d_e_r_e_d (high to low) + list: + + LOG_EMERG A panic condition. This is normally broadcast to all + users. + + LOG_ALERT A condition that should be corrected immediately, such as a + corrupted system database. + + LOG_CRIT Critical conditions, e.g., hard device errors. + + LOG_ERR Errors. + + LOG_WARNING Warning messages. + + LOG_NOTICE Conditions that are not error conditions, but should possi- + bly be handled specially. + + LOG_INFO Informational messages. + + LOG_DEBUG Messages that contain information normally of use only when + debugging a program. + + The ooppeennlloogg() function provides for more specialized processing of the + messages sent by ssyysslloogg() and vvssyysslloogg(). The parameter _i_d_e_n_t is a string + that will be prepended to every message. The _l_o_g_o_p_t argument is a bit + field specifying logging options, which is formed by OR'ing one or more + of the following values: + + LOG_CONS If ssyysslloogg() cannot pass the message to syslogd it will at- + tempt to write the message to the console + (``_/_d_e_v_/_c_o_n_s_o_l_e_.'') + + LOG_NDELAY Open the connection to syslogd immediately. Normally the + open is delayed until the first message is logged. Useful + for programs that need to manage the order in which file + descriptors are allocated. + + LOG_PERROR Write the message to standard error output as well to the + system log. + + LOG_PID Log the process id with each message: useful for identify- + ing instantiations of daemons. + + The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all + messages that do not have an explicit facility encoded: + + LOG_AUTH The authorization system: login(1), su(1), getty(8), + etc. + + LOG_AUTHPRIV The same as LOG_AUTH, but logged to a file readable only by + selected individuals. + + LOG_CRON The clock daemon. + + LOG_DAEMON System daemons, such as routed(8), that are not provided + for explicitly by other facilities. + + LOG_KERN Messages generated by the kernel. These cannot be generat- + ed by any user processes. + + LOG_LPR The line printer spooling system: lpr(1), lpc(8), lpd(8), + etc. + + LOG_MAIL The mail system. + + LOG_NEWS The network news system. + + LOG_SYSLOG Messages generated internally by syslogd(8). + + LOG_USER Messages generated by random user processes. This is the + default facility identifier if none is specified. + + LOG_UUCP The uucp system. + + LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through + LOG_LOCAL7. + + The cclloosseelloogg() function can be used to close the log file. + + The sseettllooggmmaasskk() function sets the log priority mask to _m_a_s_k_p_r_i and re- + turns the previous mask. Calls to ssyysslloogg() with a priority not set in + _m_a_s_k_p_r_i are rejected. The mask for an individual priority _p_r_i is calcu- + lated by the macro LLOOGG__MMAASSKK(_p_r_i); the mask for all priorities up to and + including _t_o_p_p_r_i is given by the macro LLOOGG__UUPPTTOO(_t_o_p_p_r_i);. The default al- + lows all priorities to be logged. + +RREETTUURRNN VVAALLUUEESS + The routines cclloosseelloogg(), ooppeennlloogg(), ssyysslloogg() and vvssyysslloogg() return no val- + ue. + + + The routine sseettllooggmmaasskk() always returns the previous log mask level. + +EEXXAAMMPPLLEESS + syslog(LOG_ALERT, "who: internal error 23"); + + openlog("ftpd", LOG_PID, LOG_DAEMON); + setlogmask(LOG_UPTO(LOG_ERR)); + syslog(LOG_INFO, "Connection from host %d", CallingHost); + + syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); + +SSEEEE AALLSSOO + logger(1), syslogd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/confstr.0 b/usr/share/man/cat3/confstr.0 new file mode 100644 index 0000000000..dffaddbcff --- /dev/null +++ b/usr/share/man/cat3/confstr.0 @@ -0,0 +1,53 @@ +CONFSTR(3) BSD Programmer's Manual CONFSTR(3) + +NNAAMMEE + ccoonnffssttrr - get string-valued configurable variables + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_i_z_e___t + ccoonnffssttrr(_i_n_t _n_a_m_e, _c_h_a_r _*_b_u_f, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ssyyssccttll((33)).. + + The ccoonnffssttrr() function provides a method for applications to get configu- + ration defined string values. + + The _n_a_m_e argument specifies the system variable to be queried. Symbolic + constants for each name value are found in the include file . + The _l_e_n argument specifies the size of the buffer referenced by the argu- + ment _b_u_f. If _l_e_n is non-zero, _b_u_f is a non-null pointer, and _n_a_m_e has a + value, up to _l_e_n - 1 bytes of the value are copied into the buffer _b_u_f. + The copied value is always null terminated. + + The available values are as follows: + + _CS_PATH + Return a value for the PATH environment variable that finds all + the standard utilities. + +RREETTUURRNN VVAALLUUEESS + If the call to ccoonnffssttrr is not successful, -1 is returned and _e_r_r_n_o is set + appropriately. Otherwise, if the variable does not have a configuration + defined value, 0 is returned and _e_r_r_n_o is not modified. Otherwise, the + buffer size needed to hold the entire configuration-defined value is re- + turned. If this size is greater than the argument _l_e_n, the string in _b_u_f + was truncated. + +EERRRROORRSS + The ccoonnffssttrr function may fail and set _e_r_r_o_r for any of the errors speci- + fied for the library functions malloc(3) and sysctl(3). + + In addition, the following errors may be reported: + + [EINVAL] The value of the _n_a_m_e argument is invalid. + +SSEEEE AALLSSOO + sysctl(3) + +HHIISSTTOORRYY + The ccoonnffssttrr function first appeared in 4.4BSD. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/crypt.0 b/usr/share/man/cat3/crypt.0 new file mode 100644 index 0000000000..af78b5cc72 --- /dev/null +++ b/usr/share/man/cat3/crypt.0 @@ -0,0 +1,106 @@ +CRYPT(3) BSD Programmer's Manual CRYPT(3) + +NNAAMMEE + ccrryypptt, sseettkkeeyy, eennccrryypptt, ddeess__sseettkkeeyy, ddeess__cciipphheerr - DES encryption + +SSYYNNOOPPSSIISS + _c_h_a_r + **ccrryypptt(_c_o_n_s_t _c_h_a_r _*_k_e_y, _c_o_n_s_t _c_h_a_r _*_s_e_t_t_i_n_g); + + _i_n_t + sseettkkeeyy(_c_h_a_r _*_k_e_y); + + _i_n_t + eennccrryypptt(_c_h_a_r _*_b_l_o_c_k, _i_n_t _f_l_a_g); + + _i_n_t + ddeess__sseettkkeeyy(_c_o_n_s_t _c_h_a_r _*_k_e_y); + + _i_n_t + ddeess__cciipphheerr(_c_o_n_s_t _c_h_a_r _*_i_n, _c_h_a_r _*_o_u_t, _l_o_n_g _s_a_l_t, _i_n_t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The crypt function performs password encryption. It is derived from the + NBS Data Encryption Standard. Additional code has been added to deter + key search attempts. The first argument to ccrryypptt is a NUL-terminated + string (normally a password typed by a user). The second is a character + array, 9 bytes in length, consisting of an underscore (``_'') followed by + 4 bytes of iteration count and 4 bytes of salt. Both the iteration _c_o_u_n_t + and the _s_a_l_t are encoded with 6 bits per character, least significant + bits first. The values 0 to 63 are encoded by the characters ``./0-9A- + Za-z'', respectively. + + The _s_a_l_t is used to induce disorder in to the DES algorithm in one of + 16777216 possible ways (specifically, if bit _i of the _s_a_l_t is set then + bits _i and _i_+_2_4 are swapped in the DES ``E'' box output). The _k_e_y is di- + vided into groups of 8 characters (a short final group is null-padded) + and the low-order 7 bits of each each character (56 bits per group) are + used to form the DES key as follows: the first group of 56 bits becomes + the initial DES key. For each additional group, the XOR of the group + bits and the encryption of the DES key with itself becomes the next DES + key. Then the final DES key is used to perform _c_o_u_n_t cumulative encryp- + tions of a 64-bit constant. The value returned is a NUL-terminated + string, 20 bytes in length, consisting of the _s_e_t_t_i_n_g followed by the en- + coded 64-bit encryption. + + For compatibility with historical versions of crypt(3), the _s_e_t_t_i_n_g may + consist of 2 bytes of salt, encoded as above, in which case an iteration + _c_o_u_n_t of 25 is used, fewer perturbations of DES are available, at most 8 + characters of _k_e_y are used, and the returned value is a NUL-terminated + string 13 bytes in length. + + The functions, eennccrryypptt(), sseettkkeeyy(), ddeess__sseettkkeeyy() and ddeess__cciipphheerr() allow + limited access to the DES algorithm itself. The _k_e_y argument to sseettkkeeyy() + is a 64 character array of binary values (numeric 0 or 1). A 56-bit key + is derived from this array by dividing the array into groups of 8 and ig- + noring the last bit in each group. + + The eennccrryypptt() argument _b_l_o_c_k is also a 64 character array of binary val- + ues. If the value of _f_l_a_g is 0, the argument _b_l_o_c_k is encrypted, other- + wise it is decrypted. The encryption or decryption is returned in the + original array _b_l_o_c_k after using the key specified by sseettkkeeyy() to process + it. + + The ddeess__sseettkkeeyy() and ddeess__cciipphheerr() functions are faster but less portable + than sseettkkeeyy() and eennccrryypptt(). The argument to ddeess__sseettkkeeyy() is a character + array of length 8. The _l_e_a_s_t significant bit in each character is ig- + nored and the next 7 bits of each character are concatenated to yield a + 56-bit key. The function ddeess__cciipphheerr() encrypts (or decrypts if _c_o_u_n_t is + negative) the 64-bits stored in the 8 characters at _i_n using abs(3) of + _c_o_u_n_t iterations of DES and stores the 64-bit result in the 8 characters + at _o_u_t. The _s_a_l_t specifies perturbations to DES as described above. + + The function ccrryypptt() returns a pointer to the encrypted value on success + and NULL on failure. The functions sseettkkeeyy(), eennccrryypptt(), ddeess__sseettkkeeyy(), + and ddeess__cciipphheerr() return 0 on success and 1 on failure. Historically, the + functions sseettkkeeyy() and eennccrryypptt() did not return any value. They have + been provided return values primarily to distinguish implementations + where hardware support is provided but not available or where the DES en- + cryption is not available due to the usual political silliness. + +SSEEEE AALLSSOO + login(1), passwd(1), getpass(3), passwd(5) + + + Wayne Patterson, _M_a_t_h_e_m_a_t_i_c_a_l _C_r_y_p_t_o_l_o_g_y _f_o_r _C_o_m_p_u_t_e_r _S_c_i_e_n_t_i_s_t_s _a_n_d + _M_a_t_h_e_m_a_t_i_c_i_a_n_s, ISBN 0-8476-7438-X, 1987. + + R. Morris, and Ken Thompson, "Password Security: A Case History", + _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, vol. 22, pp. 594-597, Nov. 1979. + + M.E. Hellman, "DES will be Totally Insecure within Ten Years", _I_E_E_E + _S_p_e_c_t_r_u_m, vol. 16, pp. 32-39, July 1979. + +HHIISSTTOORRYY + A rotor-based ccrryypptt() function appeared in Version 6 AT&T UNIX. The cur- + rent style ccrryypptt() first appeared in Version 7 AT&T UNIX. + +BBUUGGSS + Dropping the _l_e_a_s_t significant bit in each character of the argument to + ddeess__sseettkkeeyy() is ridiculous. + + The ccrryypptt() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ccrryypptt() will modi- + fy the same object. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/ctermid.0 b/usr/share/man/cat3/ctermid.0 new file mode 100644 index 0000000000..cfd8ee9a35 --- /dev/null +++ b/usr/share/man/cat3/ctermid.0 @@ -0,0 +1,42 @@ +CTERMID(3) BSD Programmer's Manual CTERMID(3) + +NNAAMMEE + cctteerrmmiidd - generate terminal pathname + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + cctteerrmmiidd(_c_h_a_r _*_b_u_f); + +DDEESSCCRRIIPPTTIIOONN + The cctteerrmmiidd() function generates a string, that, when used as a pathname, + refers to the current controlling terminal of the calling process. + + If _b_u_f is the NULL pointer, a pointer to a static area is returned. Oth- + erwise, the pathname is copied into the memory referenced by _b_u_f. The ar- + gument _b_u_f is assumed to be at least L_ctermid (as defined in the include + file <_s_t_d_i_o_._h>) bytes long. + + The current implementation simply returns `/dev/tty'. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a non-NULL pointer is returned. Otherwise, a + NULL pointer is returned and the global variable _e_r_r_n_o is set to indicate + the error. + +EERRRROORRSS + The current implementation detects no error conditions. + +SSEEEE AALLSSOO + ttyname(3) + +SSTTAANNDDAARRDDSS + The ctermid function conforms to IEEE Std1003.1-1988 (``POSIX''). + +BBUUGGSS + By default the cctteerrmmiidd() function writes all information to an internal + static object. Subsequent calls to cctteerrmmiidd() will modify the same ob- + ject. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ctime.0 b/usr/share/man/cat3/ctime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/ctime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/ctype.0 b/usr/share/man/cat3/ctype.0 new file mode 100644 index 0000000000..9af809118a --- /dev/null +++ b/usr/share/man/cat3/ctype.0 @@ -0,0 +1,58 @@ +CTYPE(3) BSD Programmer's Manual CTYPE(3) + +NNAAMMEE + iissaallnnuumm, iissaallpphhaa, iissaasscciiii, iissbbllaannkk, iissccnnttrrll, iissddiiggiitt, iissggrraapphh, iisslloowweerr, + iisspprriinntt, iissppuunncctt, iissssppaaccee, iissuuppppeerr, iissxxddiiggiitt, ttooaasscciiii ttoolloowweerr, ttoouuppppeerr, - + character classification macros + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + _i_n_t _c + + iissaallnnuumm(_i_n_t _c); + + iissaallpphhaa(_i_n_t _c); + + iissaasscciiii(_i_n_t _c); + + iissccnnttrrll(_i_n_t _c); + + iissddiiggiitt(_i_n_t _c); + + iissggrraapphh(_i_n_t _c); + + iisslloowweerr(_i_n_t _c); + + iisspprriinntt(_i_n_t _c); + + iissppuunncctt(_i_n_t _c); + + iissssppaaccee(_i_n_t _c); + + iissuuppppeerr(_i_n_t _c); + + iissxxddiiggiitt(_i_n_t _c); + + ttooaasscciiii(_i_n_t _c); + + ttoolloowweerr(_i_n_t _c); + + ttoouuppppeerr(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The above functions perform character tests and conversions on the inte- + ger _c. They are available as macros, defined in the include file + <_c_t_y_p_e_._h>, or as true functions in the C library. See the specific manu- + al pages for more information. + +SSEEEE AALLSSOO + isalnum(3), isalpha(3), isascii(3), isblank(3), iscntrl(3), + isdigit(3), isgraph(3), islower(3), isprint(3), ispunct(3), + isspace(3), isupper(3), isxdigit(3), toascii(3), tolower(3), + toupper(3), ascii(7) + +SSTTAANNDDAARRDDSS + These functions, except for iissbbllaannkk(), ttoouuppppeerr(), ttoolloowweerr() and + ttooaasscciiii(), conform to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/daemon.0 b/usr/share/man/cat3/daemon.0 new file mode 100644 index 0000000000..5c211c88b3 --- /dev/null +++ b/usr/share/man/cat3/daemon.0 @@ -0,0 +1,29 @@ +DAEMON(3) BSD Programmer's Manual DAEMON(3) + +NNAAMMEE + ddaaeemmoonn - run in the background + +SSYYNNOOPPSSIISS + ddaaeemmoonn(_i_n_t _n_o_c_h_d_i_r, _i_n_t _n_o_c_l_o_s_e); + +DDEESSCCRRIIPPTTIIOONN + The ddaaeemmoonn() function is for programs wishing to detach themselves from + the controlling terminal and run in the background as system daemons. + + Unless the argument _n_o_c_h_d_i_r is non-zero, ddaaeemmoonn() changes the current + working directory to the root (``/''). + + Unless the argument _n_o_c_l_o_s_e is non-zero, ddaaeemmoonn() will redirect standard + input, standard output and standard error to ``/dev/null''. + +EERRRROORRSS + The function ddaaeemmoonn() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions fork(2) and setsid(2). + +SSEEEE AALLSSOO + setsid(2) + +HHIISSTTOORRYY + The ddaaeemmoonn() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/db.0 b/usr/share/man/cat3/db.0 new file mode 100644 index 0000000000..4bea5eaeee --- /dev/null +++ b/usr/share/man/cat3/db.0 @@ -0,0 +1,462 @@ + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + +NNAAMMEE + dbopen - database access methods + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + DDBB ** + ddbbooppeenn((ccoonnsstt cchhaarr **ffiillee,, iinntt ffllaaggss,, iinntt mmooddee,, DDBBTTYYPPEE ttyyppee,, + ccoonnsstt vvooiidd **ooppeenniinnffoo));; + +DDEESSCCRRIIPPTTIIOONN + _D_b_o_p_e_n 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 + _b_t_r_e_e(3), _h_a_s_h(3) and _r_e_c_n_o(3). + + Dbopen opens _f_i_l_e for reading and/or writing. Files never + intended to be preserved on disk may be created by setting + the file parameter to NULL. + + The _f_l_a_g_s and _m_o_d_e _a_r_g_u_m_e_n_t_s are as specified to the + _o_p_e_n(2) routine, however, only the O_CREAT, O_EXCL, + O_EXLOCK, O_RDONLY, O_RDWR, O_SHLOCK and O_TRUNC flags are + meaningful. (Note, opening a database file O_WRONLY is + not possible.) + + The _t_y_p_e argument is of type DBTYPE (as defined in the + include file) and may be set to DB_BTREE, DB_HASH + or DB_RECNO. + + The _o_p_e_n_i_n_f_o argument is a pointer to an access method + specific structure described in the access method's manual + page. If _o_p_e_n_i_n_f_o is NULL, each access method will use + defaults appropriate for the system and the access method. + + _D_b_o_p_e_n returns a pointer to a DB structure on success and + NULL on error. The DB structure is defined in the + include file, and contains at least the following fields: + + typedef struct { + DBTYPE type; + int (*close)(const DB *db); + int (*del)(const DB *db, const DBT *key, u_int flags); + int (*fd)(const DB *db); + + + +4.4 Berkeley Distribution June 4, 1993 1 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + int (*get)(const DB *db, DBT *key, DBT *data, u_int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + u_int flags); + int (*sync)(const DB *db, u_int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, u_int flags); + } DB; + + These elements describe a database type and a set of func- + tions performing various actions. These functions take a + pointer to a structure as returned by _d_b_o_p_e_n, and some- + times one or more pointers to key/data structures and a + flag value. + + type The type of the underlying access method (and file + format). + + close A pointer to a routine to flush any cached informa- + tion 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 _c_l_o_s_e or _s_y_n_c function may result in incon- + sistent or lost information. _C_l_o_s_e routines return + -1 on error (setting _e_r_r_n_o) and 0 on success. + + del A pointer to a routine to remove key/data pairs + from the database. + + The parameter _f_l_a_g may be set to the following + value: + + R_CURSOR + Delete the record referenced by the cursor. + The cursor must have previously been ini- + tialized. + + _D_e_l_e_t_e routines return -1 on error (setting _e_r_r_n_o), + 0 on success, and 1 if the specified _k_e_y was not in + the file. + + 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 + _d_b_o_p_e_n with the same _f_i_l_e name. This file descrip- + tor may be safely used as a argument to the + _f_c_n_t_l(2) and _f_l_o_c_k(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. _F_d routines return -1 on error (setting + _e_r_r_n_o), and the file descriptor on success. + + + +4.4 Berkeley Distribution June 4, 1993 2 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + 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 + _k_e_y are returned in the structure referenced by + _d_a_t_a. _G_e_t routines return -1 on error (setting + _e_r_r_n_o), 0 on success, and 1 if the _k_e_y was not in + the file. + + put A pointer to a routine to store key/data pairs in + the database. + + The parameter _f_l_a_g may be set to one of the follow- + ing values: + + R_CURSOR + Replace the key/data pair referenced by the + cursor. The cursor must have previously + been initialized. + + R_IAFTER + Append the data immediately after the data + referenced by _k_e_y, creating a new key/data + pair. The record number of the appended + key/data pair is returned in the _k_e_y struc- + ture. (Applicable only to the DB_RECNO + access method.) + + R_IBEFORE + Insert the data immediately before the data + referenced by _k_e_y, creating a new key/data + pair. The record number of the inserted + key/data pair is returned in the _k_e_y struc- + ture. (Applicable only to the DB_RECNO + access method.) + + R_NOOVERWRITE + Enter the new key/data pair only if the key + does not previously exist. + + R_SETCURSOR + Store the key/data pair, setting or initial- + izing the position of the cursor to refer- + ence it. (Applicable only to the DB_BTREE + and DB_RECNO access methods.) + + R_SETCURSOR is available only for the DB_BTREE and + DB_RECNO access methods because it implies that the + keys have an inherent order which does not change. + + R_IAFTER and R_IBEFORE are available only for the + DB_RECNO access method because they each imply that + + + +4.4 Berkeley Distribution June 4, 1993 3 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + the access method is able to create new keys. This + is only true if the keys are ordered and indepen- + dent, record numbers for example. + + The default behavior of the _p_u_t routines is to + enter the new key/data pair, replacing any previ- + ously existing key. + + _P_u_t routines return -1 on error (setting _e_r_r_n_o), 0 + on success, and 1 if the R_NOOVERWRITE _f_l_a_g was set + and the key already exists in the file. + + 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 _k_e_y, and the address and + length of the data are returned in the structure + referenced by _d_a_t_a. + + Sequential key/data pair retrieval may begin at any + time, and the position of the ``cursor'' is not + affected by calls to the _d_e_l, _g_e_t, _p_u_t, or _s_y_n_c + routines. Modifications to the database during a + sequential scan will be reflected in the scan, i.e. + records inserted behind the cursor will not be + returned while records inserted in front of the + cursor will be returned. + + The flag value mmuusstt be set to one of the following + values: + + R_CURSOR + The data associated with the specified key + is returned. This differs from the _g_e_t rou- + tines in that it sets or initializes the + cursor to the location of the key as well. + (Note, for the 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 par- + tial key matches and range searches.) + + R_FIRST + The first key/data pair of the database is + returned, and the cursor is set or initial- + ized to reference it. + + R_LAST The last key/data pair of the database is + returned, and the cursor is set or initial- + ized to reference it. (Applicable only to + + + +4.4 Berkeley Distribution June 4, 1993 4 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + the DB_BTREE and DB_RECNO access methods.) + + R_NEXT Retrieve the key/data pair immediately after + the cursor. If the cursor is not yet set, + this is the same as the R_FIRST flag. + + R_PREV Retrieve the key/data pair immediately + before the cursor. If the cursor is not yet + set, this is the same as the R_LAST flag. + (Applicable only to the DB_BTREE and + DB_RECNO access methods.) + + R_LAST and R_PREV are available only for the + DB_BTREE and DB_RECNO access methods because they + each imply that the keys have an inherent order + which does not change. + + _S_e_q routines return -1 on error (setting _e_r_r_n_o), 0 + on success and 1 if there are no key/data pairs + less than or greater than the specified or current + key. If the 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 _s_e_q routines return 2. + + sync A pointer to a routine to flush any cached informa- + tion to disk. If the database is in memory only, + the _s_y_n_c routine has no effect and will always suc- + ceed. + + The flag value may be set to the following value: + + R_RECNOSYNC + If the 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 + _b_f_n_a_m_e field of the _r_e_c_n_o(3) manual page for + more information.) + + _S_y_n_c routines return -1 on error (setting _e_r_r_n_o) + and 0 on success. + +KKEEYY//DDAATTAA PPAAIIRRSS + Access to all file types is based on key/data pairs. Both + keys and data are represented by the following data struc- + ture: + + typedef struct { + void *data; + size_t size; + + + +4.4 Berkeley Distribution June 4, 1993 5 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + } DBT; + + The elements of the DBT structure are defined as follows: + + data A pointer to a byte string. + + size The length of the byte string. + + Key and data byte strings may reference strings of essen- + tially 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. + +EERRRROORRSS + The _d_b_o_p_e_n routine may fail and set _e_r_r_n_o for any of the + errors specified for the library routines _o_p_e_n(2) and _m_a_l_- + _l_o_c(3) or the following: + + [EFTYPE] + A file is incorrectly formatted. + + [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 with- + out prior initialization) or there is a mismatch + between the version number of file and the soft- + ware. + + The _c_l_o_s_e routines may fail and set _e_r_r_n_o for any of the + errors specified for the library routines _c_l_o_s_e(2), + _r_e_a_d(2), _w_r_i_t_e(2), _f_r_e_e(3), or _f_s_y_n_c(2). + + The _d_e_l, _g_e_t, _p_u_t and _s_e_q routines may fail and set _e_r_r_n_o + for any of the errors specified for the library routines + _r_e_a_d(2), _w_r_i_t_e(2), _f_r_e_e(3) or _m_a_l_l_o_c(3). + + The _f_d routines will fail and set _e_r_r_n_o to ENOENT for in + memory databases. + + The _s_y_n_c routines may fail and set _e_r_r_n_o for any of the + errors specified for the library routine _f_s_y_n_c(2). + +SSEEEE AALLSSOO + _b_t_r_e_e(3), _h_a_s_h(3), _m_p_o_o_l(3), _r_e_c_n_o(3) + +BBUUGGSS + The typedef DBT is a mnemonic for ``data base thang'', and + was used because noone could think of a reasonable name + + + +4.4 Berkeley Distribution June 4, 1993 6 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + that wasn't already used. + + The file descriptor interface is a kluge and will be + deleted in a future version of the interface. + + None of the access methods provide any form of concurrent + access, locking, or transactions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4.4 Berkeley Distribution June 4, 1993 7 + + + + + diff --git a/usr/share/man/cat3/dbopen.0 b/usr/share/man/cat3/dbopen.0 new file mode 100644 index 0000000000..4bea5eaeee --- /dev/null +++ b/usr/share/man/cat3/dbopen.0 @@ -0,0 +1,462 @@ + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + +NNAAMMEE + dbopen - database access methods + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + DDBB ** + ddbbooppeenn((ccoonnsstt cchhaarr **ffiillee,, iinntt ffllaaggss,, iinntt mmooddee,, DDBBTTYYPPEE ttyyppee,, + ccoonnsstt vvooiidd **ooppeenniinnffoo));; + +DDEESSCCRRIIPPTTIIOONN + _D_b_o_p_e_n 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 + _b_t_r_e_e(3), _h_a_s_h(3) and _r_e_c_n_o(3). + + Dbopen opens _f_i_l_e for reading and/or writing. Files never + intended to be preserved on disk may be created by setting + the file parameter to NULL. + + The _f_l_a_g_s and _m_o_d_e _a_r_g_u_m_e_n_t_s are as specified to the + _o_p_e_n(2) routine, however, only the O_CREAT, O_EXCL, + O_EXLOCK, O_RDONLY, O_RDWR, O_SHLOCK and O_TRUNC flags are + meaningful. (Note, opening a database file O_WRONLY is + not possible.) + + The _t_y_p_e argument is of type DBTYPE (as defined in the + include file) and may be set to DB_BTREE, DB_HASH + or DB_RECNO. + + The _o_p_e_n_i_n_f_o argument is a pointer to an access method + specific structure described in the access method's manual + page. If _o_p_e_n_i_n_f_o is NULL, each access method will use + defaults appropriate for the system and the access method. + + _D_b_o_p_e_n returns a pointer to a DB structure on success and + NULL on error. The DB structure is defined in the + include file, and contains at least the following fields: + + typedef struct { + DBTYPE type; + int (*close)(const DB *db); + int (*del)(const DB *db, const DBT *key, u_int flags); + int (*fd)(const DB *db); + + + +4.4 Berkeley Distribution June 4, 1993 1 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + int (*get)(const DB *db, DBT *key, DBT *data, u_int flags); + int (*put)(const DB *db, DBT *key, const DBT *data, + u_int flags); + int (*sync)(const DB *db, u_int flags); + int (*seq)(const DB *db, DBT *key, DBT *data, u_int flags); + } DB; + + These elements describe a database type and a set of func- + tions performing various actions. These functions take a + pointer to a structure as returned by _d_b_o_p_e_n, and some- + times one or more pointers to key/data structures and a + flag value. + + type The type of the underlying access method (and file + format). + + close A pointer to a routine to flush any cached informa- + tion 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 _c_l_o_s_e or _s_y_n_c function may result in incon- + sistent or lost information. _C_l_o_s_e routines return + -1 on error (setting _e_r_r_n_o) and 0 on success. + + del A pointer to a routine to remove key/data pairs + from the database. + + The parameter _f_l_a_g may be set to the following + value: + + R_CURSOR + Delete the record referenced by the cursor. + The cursor must have previously been ini- + tialized. + + _D_e_l_e_t_e routines return -1 on error (setting _e_r_r_n_o), + 0 on success, and 1 if the specified _k_e_y was not in + the file. + + 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 + _d_b_o_p_e_n with the same _f_i_l_e name. This file descrip- + tor may be safely used as a argument to the + _f_c_n_t_l(2) and _f_l_o_c_k(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. _F_d routines return -1 on error (setting + _e_r_r_n_o), and the file descriptor on success. + + + +4.4 Berkeley Distribution June 4, 1993 2 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + 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 + _k_e_y are returned in the structure referenced by + _d_a_t_a. _G_e_t routines return -1 on error (setting + _e_r_r_n_o), 0 on success, and 1 if the _k_e_y was not in + the file. + + put A pointer to a routine to store key/data pairs in + the database. + + The parameter _f_l_a_g may be set to one of the follow- + ing values: + + R_CURSOR + Replace the key/data pair referenced by the + cursor. The cursor must have previously + been initialized. + + R_IAFTER + Append the data immediately after the data + referenced by _k_e_y, creating a new key/data + pair. The record number of the appended + key/data pair is returned in the _k_e_y struc- + ture. (Applicable only to the DB_RECNO + access method.) + + R_IBEFORE + Insert the data immediately before the data + referenced by _k_e_y, creating a new key/data + pair. The record number of the inserted + key/data pair is returned in the _k_e_y struc- + ture. (Applicable only to the DB_RECNO + access method.) + + R_NOOVERWRITE + Enter the new key/data pair only if the key + does not previously exist. + + R_SETCURSOR + Store the key/data pair, setting or initial- + izing the position of the cursor to refer- + ence it. (Applicable only to the DB_BTREE + and DB_RECNO access methods.) + + R_SETCURSOR is available only for the DB_BTREE and + DB_RECNO access methods because it implies that the + keys have an inherent order which does not change. + + R_IAFTER and R_IBEFORE are available only for the + DB_RECNO access method because they each imply that + + + +4.4 Berkeley Distribution June 4, 1993 3 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + the access method is able to create new keys. This + is only true if the keys are ordered and indepen- + dent, record numbers for example. + + The default behavior of the _p_u_t routines is to + enter the new key/data pair, replacing any previ- + ously existing key. + + _P_u_t routines return -1 on error (setting _e_r_r_n_o), 0 + on success, and 1 if the R_NOOVERWRITE _f_l_a_g was set + and the key already exists in the file. + + 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 _k_e_y, and the address and + length of the data are returned in the structure + referenced by _d_a_t_a. + + Sequential key/data pair retrieval may begin at any + time, and the position of the ``cursor'' is not + affected by calls to the _d_e_l, _g_e_t, _p_u_t, or _s_y_n_c + routines. Modifications to the database during a + sequential scan will be reflected in the scan, i.e. + records inserted behind the cursor will not be + returned while records inserted in front of the + cursor will be returned. + + The flag value mmuusstt be set to one of the following + values: + + R_CURSOR + The data associated with the specified key + is returned. This differs from the _g_e_t rou- + tines in that it sets or initializes the + cursor to the location of the key as well. + (Note, for the 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 par- + tial key matches and range searches.) + + R_FIRST + The first key/data pair of the database is + returned, and the cursor is set or initial- + ized to reference it. + + R_LAST The last key/data pair of the database is + returned, and the cursor is set or initial- + ized to reference it. (Applicable only to + + + +4.4 Berkeley Distribution June 4, 1993 4 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + the DB_BTREE and DB_RECNO access methods.) + + R_NEXT Retrieve the key/data pair immediately after + the cursor. If the cursor is not yet set, + this is the same as the R_FIRST flag. + + R_PREV Retrieve the key/data pair immediately + before the cursor. If the cursor is not yet + set, this is the same as the R_LAST flag. + (Applicable only to the DB_BTREE and + DB_RECNO access methods.) + + R_LAST and R_PREV are available only for the + DB_BTREE and DB_RECNO access methods because they + each imply that the keys have an inherent order + which does not change. + + _S_e_q routines return -1 on error (setting _e_r_r_n_o), 0 + on success and 1 if there are no key/data pairs + less than or greater than the specified or current + key. If the 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 _s_e_q routines return 2. + + sync A pointer to a routine to flush any cached informa- + tion to disk. If the database is in memory only, + the _s_y_n_c routine has no effect and will always suc- + ceed. + + The flag value may be set to the following value: + + R_RECNOSYNC + If the 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 + _b_f_n_a_m_e field of the _r_e_c_n_o(3) manual page for + more information.) + + _S_y_n_c routines return -1 on error (setting _e_r_r_n_o) + and 0 on success. + +KKEEYY//DDAATTAA PPAAIIRRSS + Access to all file types is based on key/data pairs. Both + keys and data are represented by the following data struc- + ture: + + typedef struct { + void *data; + size_t size; + + + +4.4 Berkeley Distribution June 4, 1993 5 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + } DBT; + + The elements of the DBT structure are defined as follows: + + data A pointer to a byte string. + + size The length of the byte string. + + Key and data byte strings may reference strings of essen- + tially 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. + +EERRRROORRSS + The _d_b_o_p_e_n routine may fail and set _e_r_r_n_o for any of the + errors specified for the library routines _o_p_e_n(2) and _m_a_l_- + _l_o_c(3) or the following: + + [EFTYPE] + A file is incorrectly formatted. + + [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 with- + out prior initialization) or there is a mismatch + between the version number of file and the soft- + ware. + + The _c_l_o_s_e routines may fail and set _e_r_r_n_o for any of the + errors specified for the library routines _c_l_o_s_e(2), + _r_e_a_d(2), _w_r_i_t_e(2), _f_r_e_e(3), or _f_s_y_n_c(2). + + The _d_e_l, _g_e_t, _p_u_t and _s_e_q routines may fail and set _e_r_r_n_o + for any of the errors specified for the library routines + _r_e_a_d(2), _w_r_i_t_e(2), _f_r_e_e(3) or _m_a_l_l_o_c(3). + + The _f_d routines will fail and set _e_r_r_n_o to ENOENT for in + memory databases. + + The _s_y_n_c routines may fail and set _e_r_r_n_o for any of the + errors specified for the library routine _f_s_y_n_c(2). + +SSEEEE AALLSSOO + _b_t_r_e_e(3), _h_a_s_h(3), _m_p_o_o_l(3), _r_e_c_n_o(3) + +BBUUGGSS + The typedef DBT is a mnemonic for ``data base thang'', and + was used because noone could think of a reasonable name + + + +4.4 Berkeley Distribution June 4, 1993 6 + + + + + + + + +DBOPEN(3) BSD Programmer's Manual DBOPEN(3) + + + that wasn't already used. + + The file descriptor interface is a kluge and will be + deleted in a future version of the interface. + + None of the access methods provide any form of concurrent + access, locking, or transactions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4.4 Berkeley Distribution June 4, 1993 7 + + + + + diff --git a/usr/share/man/cat3/devname.0 b/usr/share/man/cat3/devname.0 new file mode 100644 index 0000000000..4f324f37d1 --- /dev/null +++ b/usr/share/man/cat3/devname.0 @@ -0,0 +1,25 @@ +DEVNAME(3) BSD Programmer's Manual DEVNAME(3) + +NNAAMMEE + ddeevvnnaammee - get device name + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ddeevvnnaammee(_d_e_v___t _d_e_v, _m_o_d_e___t _t_y_p_e); + +DDEESSCCRRIIPPTTIIOONN + The ddeevvnnaammee() function returns a pointer to the name of the block or + character device in ``_/_d_e_v'' with a device number of _d_e_v, and a file type + matching the one encoded in _t_y_p_e which must be one of S_IFBLK or S_IFCHR. + If no device matches the specified values, or no information is avail- + able, the string ``??'' is returned. + +SSEEEE AALLSSOO + stat(2), dev_mkdb(8) + +HHIISSTTOORRYY + The ddeevvnnaammee function call appeared in 4.4BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/difftime.0 b/usr/share/man/cat3/difftime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/difftime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/directory.0 b/usr/share/man/cat3/directory.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/directory.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/dirfd.0 b/usr/share/man/cat3/dirfd.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/dirfd.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/div.0 b/usr/share/man/cat3/div.0 new file mode 100644 index 0000000000..e6e367d5fe --- /dev/null +++ b/usr/share/man/cat3/div.0 @@ -0,0 +1,23 @@ +DIV(3) BSD Programmer's Manual DIV(3) + +NNAAMMEE + ddiivv - return quotient and remainder from division + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_i_v___t + ddiivv(_i_n_t _n_u_m, _i_n_t _d_e_n_o_m); + +DDEESSCCRRIIPPTTIIOONN + The ddiivv() function computes the value _n_u_m_/_d_e_n_o_m and returns the quotient + and remainder in a structure named _d_i_v___t that contains two _i_n_t members + named _q_u_o_t and _r_e_m. + +SSEEEE AALLSSOO + ldiv(3) + +SSTTAANNDDAARRDDSS + The ddiivv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/dn_comp.0 b/usr/share/man/cat3/dn_comp.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/dn_comp.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/dn_expand.0 b/usr/share/man/cat3/dn_expand.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/dn_expand.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/encrypt.0 b/usr/share/man/cat3/encrypt.0 new file mode 100644 index 0000000000..af78b5cc72 --- /dev/null +++ b/usr/share/man/cat3/encrypt.0 @@ -0,0 +1,106 @@ +CRYPT(3) BSD Programmer's Manual CRYPT(3) + +NNAAMMEE + ccrryypptt, sseettkkeeyy, eennccrryypptt, ddeess__sseettkkeeyy, ddeess__cciipphheerr - DES encryption + +SSYYNNOOPPSSIISS + _c_h_a_r + **ccrryypptt(_c_o_n_s_t _c_h_a_r _*_k_e_y, _c_o_n_s_t _c_h_a_r _*_s_e_t_t_i_n_g); + + _i_n_t + sseettkkeeyy(_c_h_a_r _*_k_e_y); + + _i_n_t + eennccrryypptt(_c_h_a_r _*_b_l_o_c_k, _i_n_t _f_l_a_g); + + _i_n_t + ddeess__sseettkkeeyy(_c_o_n_s_t _c_h_a_r _*_k_e_y); + + _i_n_t + ddeess__cciipphheerr(_c_o_n_s_t _c_h_a_r _*_i_n, _c_h_a_r _*_o_u_t, _l_o_n_g _s_a_l_t, _i_n_t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The crypt function performs password encryption. It is derived from the + NBS Data Encryption Standard. Additional code has been added to deter + key search attempts. The first argument to ccrryypptt is a NUL-terminated + string (normally a password typed by a user). The second is a character + array, 9 bytes in length, consisting of an underscore (``_'') followed by + 4 bytes of iteration count and 4 bytes of salt. Both the iteration _c_o_u_n_t + and the _s_a_l_t are encoded with 6 bits per character, least significant + bits first. The values 0 to 63 are encoded by the characters ``./0-9A- + Za-z'', respectively. + + The _s_a_l_t is used to induce disorder in to the DES algorithm in one of + 16777216 possible ways (specifically, if bit _i of the _s_a_l_t is set then + bits _i and _i_+_2_4 are swapped in the DES ``E'' box output). The _k_e_y is di- + vided into groups of 8 characters (a short final group is null-padded) + and the low-order 7 bits of each each character (56 bits per group) are + used to form the DES key as follows: the first group of 56 bits becomes + the initial DES key. For each additional group, the XOR of the group + bits and the encryption of the DES key with itself becomes the next DES + key. Then the final DES key is used to perform _c_o_u_n_t cumulative encryp- + tions of a 64-bit constant. The value returned is a NUL-terminated + string, 20 bytes in length, consisting of the _s_e_t_t_i_n_g followed by the en- + coded 64-bit encryption. + + For compatibility with historical versions of crypt(3), the _s_e_t_t_i_n_g may + consist of 2 bytes of salt, encoded as above, in which case an iteration + _c_o_u_n_t of 25 is used, fewer perturbations of DES are available, at most 8 + characters of _k_e_y are used, and the returned value is a NUL-terminated + string 13 bytes in length. + + The functions, eennccrryypptt(), sseettkkeeyy(), ddeess__sseettkkeeyy() and ddeess__cciipphheerr() allow + limited access to the DES algorithm itself. The _k_e_y argument to sseettkkeeyy() + is a 64 character array of binary values (numeric 0 or 1). A 56-bit key + is derived from this array by dividing the array into groups of 8 and ig- + noring the last bit in each group. + + The eennccrryypptt() argument _b_l_o_c_k is also a 64 character array of binary val- + ues. If the value of _f_l_a_g is 0, the argument _b_l_o_c_k is encrypted, other- + wise it is decrypted. The encryption or decryption is returned in the + original array _b_l_o_c_k after using the key specified by sseettkkeeyy() to process + it. + + The ddeess__sseettkkeeyy() and ddeess__cciipphheerr() functions are faster but less portable + than sseettkkeeyy() and eennccrryypptt(). The argument to ddeess__sseettkkeeyy() is a character + array of length 8. The _l_e_a_s_t significant bit in each character is ig- + nored and the next 7 bits of each character are concatenated to yield a + 56-bit key. The function ddeess__cciipphheerr() encrypts (or decrypts if _c_o_u_n_t is + negative) the 64-bits stored in the 8 characters at _i_n using abs(3) of + _c_o_u_n_t iterations of DES and stores the 64-bit result in the 8 characters + at _o_u_t. The _s_a_l_t specifies perturbations to DES as described above. + + The function ccrryypptt() returns a pointer to the encrypted value on success + and NULL on failure. The functions sseettkkeeyy(), eennccrryypptt(), ddeess__sseettkkeeyy(), + and ddeess__cciipphheerr() return 0 on success and 1 on failure. Historically, the + functions sseettkkeeyy() and eennccrryypptt() did not return any value. They have + been provided return values primarily to distinguish implementations + where hardware support is provided but not available or where the DES en- + cryption is not available due to the usual political silliness. + +SSEEEE AALLSSOO + login(1), passwd(1), getpass(3), passwd(5) + + + Wayne Patterson, _M_a_t_h_e_m_a_t_i_c_a_l _C_r_y_p_t_o_l_o_g_y _f_o_r _C_o_m_p_u_t_e_r _S_c_i_e_n_t_i_s_t_s _a_n_d + _M_a_t_h_e_m_a_t_i_c_i_a_n_s, ISBN 0-8476-7438-X, 1987. + + R. Morris, and Ken Thompson, "Password Security: A Case History", + _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, vol. 22, pp. 594-597, Nov. 1979. + + M.E. Hellman, "DES will be Totally Insecure within Ten Years", _I_E_E_E + _S_p_e_c_t_r_u_m, vol. 16, pp. 32-39, July 1979. + +HHIISSTTOORRYY + A rotor-based ccrryypptt() function appeared in Version 6 AT&T UNIX. The cur- + rent style ccrryypptt() first appeared in Version 7 AT&T UNIX. + +BBUUGGSS + Dropping the _l_e_a_s_t significant bit in each character of the argument to + ddeess__sseettkkeeyy() is ridiculous. + + The ccrryypptt() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ccrryypptt() will modi- + fy the same object. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/endfsent.0 b/usr/share/man/cat3/endfsent.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/endfsent.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/endgrent.0 b/usr/share/man/cat3/endgrent.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/endgrent.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/endhostent.0 b/usr/share/man/cat3/endhostent.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/endhostent.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/endnetent.0 b/usr/share/man/cat3/endnetent.0 new file mode 100644 index 0000000000..24b8430da1 --- /dev/null +++ b/usr/share/man/cat3/endnetent.0 @@ -0,0 +1,81 @@ +GETNETENT(3) BSD Programmer's Manual GETNETENT(3) + +NNAAMMEE + ggeettnneetteenntt, ggeettnneettbbyyaaddddrr, ggeettnneettbbyynnaammee, sseettnneetteenntt, eennddnneetteenntt - get network + entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneetteenntt(); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyyaaddddrr(_l_o_n_g _n_e_t, _i_n_t _t_y_p_e); + + sseettnneetteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddnneetteenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettnneetteenntt(), ggeettnneettbbyynnaammee(), and ggeettnneettbbyyaaddddrr() functions each return + a pointer to an object with the following structure containing the bro- + ken-out fields of a line in the network data base, _/_e_t_c_/_n_e_t_w_o_r_k_s. + + struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net number type */ + unsigned long n_net; /* net number */ + }; + + The members of this structure are: + + _n___n_a_m_e The official name of the network. + + _n___a_l_i_a_s_e_s A zero terminated list of alternate names for the network. + + _n___a_d_d_r_t_y_p_e The type of the network number returned; currently only + AF_INET. + + _n___n_e_t The network number. Network numbers are returned in machine + byte order. + + The ggeettnneetteenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettnneetteenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettnneettbbyynnaammee() or ggeettnneettbbyyaaddddrr(). + + The eennddnneetteenntt() function closes the file. + + The ggeettnneettbbyynnaammee() function and ggeettnneettbbyyaaddddrr() sequentially search from + the beginning of the file until a matching net name or net address and + type is found, or until EOF is encountered. Network numbers are supplied + in host order. + +FFIILLEESS + /etc/networks + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + networks(5) + +HHIISSTTOORRYY + The ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), ggeettnneettbbyynnaammee(), sseettnneetteenntt(), and + eennddnneetteenntt() functions appeared in 4.2BSD. + +BBUUGGSS + The data space used by these functions is static; if future use requires + the data, it should be copied before any subsequent calls to these func- + tions overwrite it. Only Internet network numbers are currently under- + stood. Expecting network numbers to fit in no more than 32 bits is prob- + ably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/endnetgrent.0 b/usr/share/man/cat3/endnetgrent.0 new file mode 100644 index 0000000000..1588f2b94f --- /dev/null +++ b/usr/share/man/cat3/endnetgrent.0 @@ -0,0 +1,64 @@ +GETNETGRENT(3) BSD Programmer's Manual GETNETGRENT(3) + +NNAAMMEE + ggeettnneettggrreenntt, iinnnneettggrr, sseettnneettggrreenntt, eennddnneettggrreenntt - netgroup database opera- + tions + +SSYYNNOOPPSSIISS + _i_n_t + ggeettnneettggrreenntt(_c_h_a_r _*_*_h_o_s_t_, _c_h_a_r _*_*_u_s_e_r_, _c_h_a_r _*_*_d_o_m_a_i_n); + + _i_n_t + iinnnneettggrr(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p_, _c_o_n_s_t _c_h_a_r _*_h_o_s_t_, _c_o_n_s_t _c_h_a_r _*_u_s_e_r_, ); + + _v_o_i_d + sseettnneettggrreenntt(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p); + + _v_o_i_d + eennddnneettggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the netgroup database file _/_e_t_c_/_n_e_t_g_r_o_u_p which + is described in netgroup(5). The database defines a set of netgroups, + each made up of one or more triples: + + (host, user, domain) + that defines a combination of host, user and domain. Any of the three + fields may be specified as ``wildcards'' that match any string. + + The function ggeettnneettggrreenntt() sets the three pointer arguments to the + strings of the next member of the current netgroup. If any of the string + pointers are ((cchhaarr **))00 that field is considered a wildcard. + + The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() set the current netgroup + and terminate the current netgroup respectively. If sseettnneettggrreenntt() is + called with a different netgroup than the previous call, an implicit + eennddnneettggrreenntt() is implied. SSeettnneettggrreenntt() also sets the offset to the + first member of the netgroup. + + The function iinnnneettggrr() searches for a match of all fields within the + specified group. If any of the hhoosstt, uusseerr, or ddoommaaiinn arguments are ((cchhaarr + **))00 those fields will match any string value in the netgroup member. + +RREETTUURRNN VVAALLUUEESS + The function ggeettnneettggrreenntt() returns 0 for ``no more netgroup members'' and + 1 otherwise. The function iinnnneettggrr() returns 1 for a successful match and + 0 otherwise. The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() have no re- + turn value. + +FFIILLEESS + /etc/netgroup netgroup database file + +SSEEEE AALLSSOO + nneettggrroouupp(_5) + +CCOOMMPPAATTIIBBIILLIITTYY + The netgroup members have three string fields to maintain compatibility + with other vendor implementations, however it is not obvious what use the + ddoommaaiinn string has within BSD. + +BBUUGGSS + The function ggeettnneettggrreenntt() returns pointers to dynamically allocated data + areas that are free'd when the function eennddnneettggrreenntt() is called. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/endprotoent.0 b/usr/share/man/cat3/endprotoent.0 new file mode 100644 index 0000000000..7fcb0b58f3 --- /dev/null +++ b/usr/share/man/cat3/endprotoent.0 @@ -0,0 +1,75 @@ +GETPROTOENT(3) BSD Programmer's Manual GETPROTOENT(3) + +NNAAMMEE + ggeettpprroottooeenntt, ggeettpprroottoobbyynnuummbbeerr, ggeettpprroottoobbyynnaammee, sseettpprroottooeenntt, eennddpprroottooeenntt - + get protocol entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottooeenntt(); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnuummbbeerr(_i_n_t _p_r_o_t_o); + + sseettpprroottooeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddpprroottooeenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnaammee(), and ggeettpprroottoobbyynnuummbbeerr() functions + each return a pointer to an object with the following structure contain- + ing the broken-out fields of a line in the network protocol data base, + _/_e_t_c_/_p_r_o_t_o_c_o_l_s. + + + struct protoent { + char *p_name; /* official name of protocol */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ + }; + + The members of this structure are: + + _p___n_a_m_e The official name of the protocol. + + _p___a_l_i_a_s_e_s A zero terminated list of alternate names for the protocol. + + _p___p_r_o_t_o The protocol number. + + The ggeettpprroottooeenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettpprroottooeenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettpprroottoobbyynnaammee() or ggeettpprroottoobbyynnuummbbeerr(). + + The eennddpprroottooeenntt() function closes the file. + + The ggeettpprroottoobbyynnaammee() function and ggeettpprroottoobbyynnuummbbeerr() sequentially search + from the beginning of the file until a matching protocol name or protocol + number is found, or until EOF is encountered. + +RREETTUURRNN VVAALLUUEESS + Null pointer (0) returned on EOF or error. + +FFIILLEESS + /etc/protocols + +SSEEEE AALLSSOO + protocols(5) + +HHIISSTTOORRYY + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnuummbbeerr(), ggeettpprroottoobbyynnaammee(), sseettpprroottooeenntt(), + and eennddpprroottooeenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use a static data space; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet protocols are currently understood. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/endpwent.0 b/usr/share/man/cat3/endpwent.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/endpwent.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/endservent.0 b/usr/share/man/cat3/endservent.0 new file mode 100644 index 0000000000..d1f930be56 --- /dev/null +++ b/usr/share/man/cat3/endservent.0 @@ -0,0 +1,83 @@ +GETSERVENT(3) BSD Programmer's Manual GETSERVENT(3) + +NNAAMMEE + ggeettsseerrvveenntt, ggeettsseerrvvbbyyppoorrtt, ggeettsseerrvvbbyynnaammee, sseettsseerrvveenntt, eennddsseerrvveenntt - get + service entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvveenntt(); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyynnaammee(_c_h_a_r _*_n_a_m_e, _c_h_a_r _*_p_r_o_t_o); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyyppoorrtt(_i_n_t _p_o_r_t, _p_r_o_t_o); + + _v_o_i_d + sseettsseerrvveenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _v_o_i_d + eennddsseerrvveenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyynnaammee(), and ggeettsseerrvvbbyyppoorrtt() functions each re- + turn a pointer to an object with the following structure containing the + broken-out fields of a line in the network services data base, + _/_e_t_c_/_s_e_r_v_i_c_e_s. + + struct servent { + char *s_name; /* official name of service */ + char **s_aliases; /* alias list */ + int s_port; /* port service resides at */ + char *s_proto; /* protocol to use */ + }; + + The members of this structure are: + + _s___n_a_m_e The official name of the service. + + _s___a_l_i_a_s_e_s A zero terminated list of alternate names for the service. + + _s___p_o_r_t The port number at which the service resides. Port numbers + are returned in network byte order. + + _s___p_r_o_t_o The name of the protocol to use when contacting the service. + + The ggeettsseerrvveenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettsseerrvveenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettsseerrvvbbyynnaammee() or ggeettsseerrvvbbyyppoorrtt(). + + The eennddsseerrvveenntt() function closes the file. + + The ggeettsseerrvvbbyynnaammee() and ggeettsseerrvvbbyyppoorrtt() functions sequentially search + from the beginning of the file until a matching protocol name or port + number is found, or until EOF is encountered. If a protocol name is also + supplied (non- NULL), searches must also match the protocol. + +FFIILLEESS + + + /etc/services + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + getprotoent(3), services(5) + +HHIISSTTOORRYY + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyyppoorrtt(), ggeettsseerrvvbbyynnaammee(), sseettsseerrvveenntt(), and + eennddsseerrvveenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Ex- + pecting port numbers to fit in a 32 bit quantity is probably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/endttyent.0 b/usr/share/man/cat3/endttyent.0 new file mode 100644 index 0000000000..5013ee00ef --- /dev/null +++ b/usr/share/man/cat3/endttyent.0 @@ -0,0 +1,98 @@ +GETTTYENT(3) BSD Programmer's Manual GETTTYENT(3) + +NNAAMMEE + ggeettttttyyeenntt, ggeettttttyynnaamm, sseettttttyyeenntt, eennddttttyyeenntt - get ttys file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyyeenntt(); + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyynnaamm(_c_h_a_r _*_n_a_m_e); + + _i_n_t + sseettttttyyeenntt(_v_o_i_d); + + _i_n_t + eennddttttyyeenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettttttyyeenntt(), and ggeettttttyynnaamm() functions each return a pointer to an + object, with the following structure, containing the broken-out fields of + a line from the tty description file. + + struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute */ + char *ty_type; /* terminal type */ + #define TTY_ON 0x01 /* enable logins */ + #define TTY_SECURE 0x02 /* allow uid of 0 to login */ + int ty_status; /* flag values */ + char *ty_window; /* command for window manager */ + char *ty_comment; /* comment field */ + }; + + The fields are as follows: + + _t_y___n_a_m_e The name of the character-special file. + + _t_y___g_e_t_t_y The name of the command invoked by init(8) to initialize tty + line characteristics. + + _t_y___t_y_p_e The name of the default terminal type connected to this tty + line. + + _t_y___s_t_a_t_u_s A mask of bit fields which indicate various actions allowed + on this tty line. The possible flags are as follows: + + TTY_ON Enables logins (i.e., init(8) will start the com- + mand referenced by _t_y___g_e_t_t_y on this entry). + + TTY_SECURE Allow users with a uid of 0 to login on this ter- + minal. + + _t_y___w_i_n_d_o_w The command to execute for a window system associated with + the line. + + _t_y___c_o_m_m_e_n_t Any trailing comment field, with any leading hash marks + (``#'') or whitespace removed. + + If any of the fields pointing to character strings are unspecified, they + are returned as null pointers. The field _t_y___s_t_a_t_u_s will be zero if no + flag values are specified. + + + See ttys(5) for a more complete discussion of the meaning and usage of + the fields. + + The ggeettttttyyeenntt() function reads the next line from the ttys file, opening + the file if necessary. The sseettttttyyeenntt() function rewinds the file if + open, or opens the file if it is unopened. The eennddttttyyeenntt() function + closes any open files. + + The ggeettttttyynnaamm() function searches from the beginning of the file until a + matching _n_a_m_e is found (or until EOF is encountered). + +RREETTUURRNN VVAALLUUEESS + The routines ggeettttttyyeenntt() and ggeettttttyynnaamm() return a null pointer on EOF or + error. The sseettttttyyeenntt() function and eennddttttyyeenntt() return 0 on failure and + 1 on success. + +FFIILLEESS + /etc/ttys + +SSEEEE AALLSSOO + login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), + init(8) + +HHIISSTTOORRYY + The ggeettttttyyeenntt(), ggeettttttyynnaamm(), sseettttttyyeenntt(), and eennddttttyyeenntt() functions ap- + peared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/endusershell.0 b/usr/share/man/cat3/endusershell.0 new file mode 100644 index 0000000000..665697eb6e --- /dev/null +++ b/usr/share/man/cat3/endusershell.0 @@ -0,0 +1,42 @@ +GETUSERSHELL(3) BSD Programmer's Manual GETUSERSHELL(3) + +NNAAMMEE + ggeettuusseerrsshheellll, sseettuusseerrsshheellll, eenndduusseerrsshheellll - get legal user shells + +SSYYNNOOPPSSIISS + _c_h_a_r _* + ggeettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + sseettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + eenndduusseerrsshheellll(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettuusseerrsshheellll() function returns a pointer to a legal user shell as + defined by the system manager in the file _/_e_t_c_/_s_h_e_l_l_s. If _/_e_t_c_/_s_h_e_l_l_s is + unreadable or does not exist, ggeettuusseerrsshheellll() behaves as if _/_b_i_n_/_s_h and + _/_b_i_n_/_c_s_h were listed in the file. + + The ggeettuusseerrsshheellll() function reads the next line (opening the file if nec- + essary); sseettuusseerrsshheellll() rewinds the file; eenndduusseerrsshheellll() closes it. + +FFIILLEESS + /etc/shells + +DDIIAAGGNNOOSSTTIICCSS + The routine ggeettuusseerrsshheellll() returns a null pointer (0) on EOF. + +SSEEEE AALLSSOO + shells(5) + +HHIISSTTOORRYY + The ggeettuusseerrsshheellll() function appeared in 4.3BSD. + +BBUUGGSS + The ggeettuusseerrsshheellll() function leaves its result in an internal static ob- + ject and returns a pointer to that object. Subsequent calls to + ggeettuusseerrsshheellll() will modify the same object. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/err.0 b/usr/share/man/cat3/err.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/err.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/errx.0 b/usr/share/man/cat3/errx.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/errx.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/exec.0 b/usr/share/man/cat3/exec.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/exec.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/execl.0 b/usr/share/man/cat3/execl.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/execl.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/execle.0 b/usr/share/man/cat3/execle.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/execle.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/execlp.0 b/usr/share/man/cat3/execlp.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/execlp.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/execv.0 b/usr/share/man/cat3/execv.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/execv.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/execvp.0 b/usr/share/man/cat3/execvp.0 new file mode 100644 index 0000000000..874443d8dd --- /dev/null +++ b/usr/share/man/cat3/execvp.0 @@ -0,0 +1,124 @@ +EXEC(3) BSD Programmer's Manual EXEC(3) + +NNAAMMEE + eexxeeccll, eexxeeccllpp, eexxeeccllee, eexxeecctt, eexxeeccvv, eexxeeccvvpp - execute a file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_*_e_n_v_i_r_o_n_; + + _i_n_t + eexxeeccll(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._.); + + _i_n_t + eexxeeccllee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_a_r_g, _._._., _c_h_a_r _*_c_o_n_s_t _e_n_v_p_[_]); + + _i_n_t + eexxeecctt(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvv(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + + _i_n_t + eexxeeccvvpp(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_h_a_r _*_c_o_n_s_t _a_r_g_v_[_]); + +DDEESSCCRRIIPPTTIIOONN + The eexxeecc family of functions replaces the current process image with a + new process image. The functions described in this manual page are + front-ends for the function execve(2). (See the manual page for execve + for detailed information about the replacement of the current process.) + + The initial argument for these functions is the pathname of a file which + is to be executed. + + The _c_o_n_s_t _c_h_a_r _*_a_r_g and subsequent ellipses in the eexxeeccll(), eexxeeccllpp(), and + eexxeeccllee() functions can be thought of as _a_r_g_0, _a_r_g_1, ..., _a_r_g_n. 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 file name associated + with the file being executed. The list of arguments _m_u_s_t be terminated + by a NULL pointer. + + The eexxeecctt(), eexxeeccvv(), and eexxeeccvvpp() 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 + file name associated with the file begin executed. The array of pointers + mmuusstt be terminated by a NULL pointer. + + The eexxeeccllee() and eexxeecctt() functions also specify the environment of the + executed process by following the NULL pointer that terminates the list + of arguments in the parameter list or the pointer to the argv array with + an additional parameter. This additional parameter is an array of point- + ers to null-terminated strings and _m_u_s_t be terminated by a NULL pointer. + The other functions take the environment for the new process image from + the external variable _e_n_v_i_r_o_n in the current process. + + Some of these functions have special semantics. + + The functions eexxeeccllpp() and eexxeeccvvpp() will duplicate the actions of the + shell in searching for an executable file if the specified file name does + not contain a slash ``/'' character. The search path is the path speci- + fied in the environment by ``PATH'' variable. If this variable isn't + specified, the default path ``/bin:/usr/bin:'' is used. In addtion, cer- + tain errors are treated specially. + + If permission is denied for a file (the attempted execve returned + EACCES), these functions will continue searching the rest of the search + path. If no other file is found, however, they will return with the + global variable _e_r_r_n_o set to EACCES. + + If the header of a file isn't recognized (the attempted execve returned + ENOEXEC), these functions will execute the shell with the path of the + file as its first argument. (If this attempt fails, no further searching + is done.) + + If the file is currently busy (the attempted execve returned ETXTBUSY), + these functions will sleep for several seconds, periodically re- + attempting to execute the file. + + The function eexxeecctt() executes a file with the program tracing facilities + enabled (see ptrace(2)). + +RREETTUURRNN VVAALLUUEESS + If any of the exec functions returns, an error will have occurred. The + return value is -1, and the global variable _e_r_r_n_o will be set to indicate + the error. + +FFIILLEESS + /bin/sh The shell. + +EERRRROORRSS + EExxeeccll(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() may fail and set _e_r_r_n_o for any + of the errors specified for the library functions execve(2) and + malloc(3). + + EExxeecctt() and eexxeeccvv() may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function execve(2). + +SSEEEE AALLSSOO + sh(1), execve(2), fork(2), trace(2), environ(7), ptrace(2), + environ(7), + +CCOOMMPPAATTIIBBIILLIITTYY + Historically, the default path for the eexxeeccllpp() and eexxeeccvvpp() functions + was ``_:_/_b_i_n_:_/_u_s_r_/_b_i_n''. This was changed to place the current directory + last to enhance system security. + + The behavior of eexxeeccllpp() and eexxeeccvvpp() 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. + + Traditionally, the functions eexxeeccllpp() and eexxeeccvvpp() ignored all errors ex- + cept for the ones described above and ENOMEM and E2BIG, upon which they + returned. They now return if any error other than the ones described + above occurs. + +SSTTAANNDDAARRDDSS + EExxeeccll(), eexxeeccvv(), eexxeeccllee(), eexxeeccllpp() and eexxeeccvvpp() conform to IEEE + Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/exit.0 b/usr/share/man/cat3/exit.0 new file mode 100644 index 0000000000..8593b55010 --- /dev/null +++ b/usr/share/man/cat3/exit.0 @@ -0,0 +1,36 @@ +EXIT(3) BSD Programmer's Manual EXIT(3) + +NNAAMMEE + eexxiitt - perform normal program termination + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eexxiitt(_i_n_t _s_t_a_t_u_s); + +DDEESSCCRRIIPPTTIIOONN + EExxiitt() terminates a process. + + Before termination it performs the following functions in the order list- + ed: + + 1. Call the functions registered with the atexit(3) function, in + the reverse order of their registration. + + 2. Flush all open output streams. + + 3. Close all open streams. + + 4. Unlink all files created with the tmpfile(3) function. + +RREETTUURRNN VVAALLUUEESS + The eexxiitt() function never returns. + +SSEEEE AALLSSOO + _exit(2), atexit(3), intro(3), tmpfile(3) + +SSTTAANNDDAARRDDSS + The eexxiitt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fclose.0 b/usr/share/man/cat3/fclose.0 new file mode 100644 index 0000000000..17e64fbe0f --- /dev/null +++ b/usr/share/man/cat3/fclose.0 @@ -0,0 +1,34 @@ +FCLOSE(3) BSD Programmer's Manual FCLOSE(3) + +NNAAMMEE + ffcclloossee - close a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffcclloossee(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffcclloossee() function dissociates the named _s_t_r_e_a_m from its underlying + file or set of functions. If the stream was being used for output, any + buffered data is written first, using fflush(3). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion 0 is returned. Otherwise, EOF is returned and + the global variable _e_r_r_n_o is set to indicate the error. In either case + no further access to the stream is possible. + +EERRRROORRSS + [EBADF] The argument _s_t_r_e_a_m is not an open stream. + + The ffcclloossee() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines close(2) or fflush(3). + +SSEEEE AALLSSOO + close(2), fflush(3), fopen(3), setbuf(3) + +SSTTAANNDDAARRDDSS + The ffcclloossee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fdopen.0 b/usr/share/man/cat3/fdopen.0 new file mode 100644 index 0000000000..895c13f644 --- /dev/null +++ b/usr/share/man/cat3/fdopen.0 @@ -0,0 +1,98 @@ +FOPEN(3) BSD Programmer's Manual FOPEN(3) + +NNAAMMEE + ffooppeenn, ffddooppeenn, ffrreeooppeenn - stream open functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffddooppeenn(_i_n_t _f_i_l_d_e_s, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffrreeooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates a stream with it. + + The argument _m_o_d_e points to a string beginning with one of the following + sequences (Additional characters may follow these sequences.): + + ``r'' Open text file for reading. The stream is positioned at the be- + ginning of the file. + + ``r+'' Open for reading and writing. The stream is positioned at the + beginning of the file. + + ``w'' Truncate file to zero length or create text file for writing. + The stream is positioned at the beginning of the file. It ``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. + + ``a'' Open for writing. The file is created if it does not exist. The + stream is positioned at the end of the file. + + ``a+'' Open for reading and writing. The file is created if it does not + exist. The stream is positioned at the end of the file. + + The _m_o_d_e string can also include the letter ``b'' either as a third char- + acter or as a character between the characters in any of the two- + character strings described above. This is strictly for compatibility + with ANSI C X3.159-1989 (``ANSI C '') and has no effect; the ``b'' is ig- + nored. + + Any created files will have mode "S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | + S_IROTH | S_IWOTH" (0666), as modified by the process' umask value (see + umask(2)). + + Reads and writes may be intermixed on read/write streams in any order, + and do not require an intermediate seek as in previous versions of _s_t_d_i_o. + This is not portable to other systems, however; ANSI C requires that a + file positioning function intervene between output and input, unless an + input operation encounters end-of-file. + + The ffddooppeenn() function associates a stream with the existing file descrip- + tor, _f_i_l_d_e_s. The _m_o_d_e of the stream must be compatible with the mode of + the file descriptor. + + The ffrreeooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates the stream pointed to by _s_t_r_e_a_m with it. The + original stream (if it exists) is closed. The _m_o_d_e argument is used just + as in the fopen function. The primary use of the ffrreeooppeenn() function is + to change the file associated with a standard text stream (_s_t_d_e_r_r, _s_t_d_i_n, + or _s_t_d_o_u_t). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() return a FILE + pointer. Otherwise, NULL is returned and the global variable _e_r_r_n_o is + set to indicate the error. + +EERRRROORRSS + [EINVAL] The _m_o_d_e provided to ffooppeenn(), ffddooppeenn(), or ffrreeooppeenn() was in- + valid. + + The ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() functions may also fail and set _e_r_r_n_o + for any of the errors specified for the routine malloc(3). + + The ffooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine open(2). + + The ffddooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine fcntl(2). + + The ffrreeooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines open(2), fclose(3) and fflush(3). + +SSEEEE AALLSSOO + open(2), fclose(3), fseek(3), funopen(3) + +SSTTAANNDDAARRDDSS + The ffooppeenn() and ffrreeooppeenn() functions conform to ANSI C X3.159-1989 (``ANSI + C ''). The ffddooppeenn() function conforms to IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/feof.0 b/usr/share/man/cat3/feof.0 new file mode 100644 index 0000000000..d9b2860109 --- /dev/null +++ b/usr/share/man/cat3/feof.0 @@ -0,0 +1,47 @@ +FERROR(3) BSD Programmer's Manual FERROR(3) + +NNAAMMEE + cclleeaarreerrrr, ffeeooff, ffeerrrroorr, ffiilleennoo - check and reset stream status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + cclleeaarreerrrr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeeooff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeerrrroorr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffiilleennoo(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function cclleeaarreerrrr() clears the end-of-file and error indicators for + the stream pointed to by _s_t_r_e_a_m. + + The function ffeeooff() tests the end-of-file indicator for the stream point- + ed to by _s_t_r_e_a_m, returning non-zero if it is set. The end-of-file indi- + cator can only be cleared by the function cclleeaarreerrrr(). + + The function ffeerrrroorr() tests the error indicator for the stream pointed to + by _s_t_r_e_a_m, returning non-zero if it is set. The error indicator can only + be reset by the cclleeaarreerrrr() function. + + The function ffiilleennoo() examines the argument _s_t_r_e_a_m and returns its inte- + ger desciptor. + +EERRRROORRSS + These functions should not fail and do not set the external variable + _e_r_r_n_o. + +SSEEEE AALLSSOO + open(2), stdio(3) + +SSTTAANNDDAARRDDSS + The functions cclleeaarreerrrr(), ffeeooff(), and ffeerrrroorr() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ferror.0 b/usr/share/man/cat3/ferror.0 new file mode 100644 index 0000000000..d9b2860109 --- /dev/null +++ b/usr/share/man/cat3/ferror.0 @@ -0,0 +1,47 @@ +FERROR(3) BSD Programmer's Manual FERROR(3) + +NNAAMMEE + cclleeaarreerrrr, ffeeooff, ffeerrrroorr, ffiilleennoo - check and reset stream status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + cclleeaarreerrrr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeeooff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeerrrroorr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffiilleennoo(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function cclleeaarreerrrr() clears the end-of-file and error indicators for + the stream pointed to by _s_t_r_e_a_m. + + The function ffeeooff() tests the end-of-file indicator for the stream point- + ed to by _s_t_r_e_a_m, returning non-zero if it is set. The end-of-file indi- + cator can only be cleared by the function cclleeaarreerrrr(). + + The function ffeerrrroorr() tests the error indicator for the stream pointed to + by _s_t_r_e_a_m, returning non-zero if it is set. The error indicator can only + be reset by the cclleeaarreerrrr() function. + + The function ffiilleennoo() examines the argument _s_t_r_e_a_m and returns its inte- + ger desciptor. + +EERRRROORRSS + These functions should not fail and do not set the external variable + _e_r_r_n_o. + +SSEEEE AALLSSOO + open(2), stdio(3) + +SSTTAANNDDAARRDDSS + The functions cclleeaarreerrrr(), ffeeooff(), and ffeerrrroorr() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fflush.0 b/usr/share/man/cat3/fflush.0 new file mode 100644 index 0000000000..e516d56138 --- /dev/null +++ b/usr/share/man/cat3/fflush.0 @@ -0,0 +1,45 @@ +FFLUSH(3) BSD Programmer's Manual FFLUSH(3) + +NNAAMMEE + fffflluusshh, ffppuurrggee - flush a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + fffflluusshh(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffppuurrggee(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function fffflluusshh() forces a write of all buffered data for the given + output or update _s_t_r_e_a_m via the stream's underlying write function. The + open status of the stream is unaffected. + + If the _s_t_r_e_a_m argument is NULL, fffflluusshh() flushes _a_l_l open output streams. + + The function ffppuurrggee() erases any input or output buffered in the given + _s_t_r_e_a_m. 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 getc(3); this includes any text pushed back via ungetc. + + +RREETTUURRNN VVAALLUUEESS + Upon successful completion 0 is returned. Otherwise, EOF is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + [EBADF] _S_t_r_e_a_m is not an open stream, or, in the case of fffflluusshh(), not a + stream open for writing. + + The function fffflluusshh() may also fail and set _e_r_r_n_o for any of the errors + specified for the routine write(2). + +SSEEEE AALLSSOO + write(2), fopen(3), fclose(3), setbuf(3) + +SSTTAANNDDAARRDDSS + The fffflluusshh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ffs.0 b/usr/share/man/cat3/ffs.0 new file mode 100644 index 0000000000..11b7e378ee --- /dev/null +++ b/usr/share/man/cat3/ffs.0 @@ -0,0 +1,23 @@ +FFS(3) BSD Programmer's Manual FFS(3) + +NNAAMMEE + ffffss - find first bit set in a bit string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffffss(_i_n_t _v_a_l_u_e); + +DDEESSCCRRIIPPTTIIOONN + The ffffss() fucntion finds the first bit set in _v_a_l_u_e and returns the index + of that bit. Bits are numbered starting from 1, starting at the right- + most bit. A return value of 0 means that the argument was zero. + +SSEEEE AALLSSOO + bitstring(3) + +HHIISSTTOORRYY + The ffffss() function appeared in 4.3BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fgetc.0 b/usr/share/man/cat3/fgetc.0 new file mode 100644 index 0000000000..69b529360b --- /dev/null +++ b/usr/share/man/cat3/fgetc.0 @@ -0,0 +1,56 @@ +GETC(3) BSD Programmer's Manual GETC(3) + +NNAAMMEE + ffggeettcc, ggeettcc, ggeettcchhaarr, ggeettww - get next character or word from input stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcchhaarr(); + + _i_n_t + ggeettww(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettcc() function obtains the next input character (if present) from + the stream pointed at by _s_t_r_e_a_m, or the next character pushed back on the + stream via ungetc. + + The ggeettcc() function acts essentially identically to ffggeettcc(), but is a + macro that expands in-line. + + The ggeettcchhaarr() function is equivalent to: getc with the argument stdin. + + The ggeettww() function obtains the next _i_n_t (if present) from the stream + pointed at by _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + If successful, these routines return the next requested object from the + _s_t_r_e_a_m. If the stream is at end-of-file or a read error occurs, the rou- + tines return EOF. The routines feof(3) and ferror(3) must be used to dis- + tinguish between end-of-file and error. If an error occurs, the global + variable _e_r_r_n_o is set to indicate the error. The end-of-file condition + is remembered, even on a terminal, and all subsequent attempts to read + will return EOF until the condition is cleared with clearerr. + +SSEEEE AALLSSOO + ferror(3), fread(3), fopen(3), putc(3), ungetc(3) + +SSTTAANNDDAARRDDSS + The ffggeettcc(), ggeettcc() and ggeettcchhaarr() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + Since EOF is a valid integer value, feof and ferror must be used to check + for failure after calling ggeettww(). The size and byte order of an _i_n_t + varies from one machine to another, and ggeettww() is not recommended for + portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fgetline.0 b/usr/share/man/cat3/fgetline.0 new file mode 100644 index 0000000000..035d41aaa9 --- /dev/null +++ b/usr/share/man/cat3/fgetline.0 @@ -0,0 +1,48 @@ +FGETLINE(3) BSD Programmer's Manual FGETLINE(3) + +NNAAMMEE + ffggeettlliinnee - get a line from a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ffggeettlliinnee(_F_I_L_E _*_s_t_r_e_a_m, _s_i_z_e___t _*_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettlliinnee() function returns a pointer to the next line from the + stream referenced by _s_t_r_e_a_m. This line is _n_o_t a C string as it does not + end with a terminating NUL character. The length of the line, including + the final newline, is stored in the memory location to which _l_e_n points. + (Note, however, that if the line is the last in a file that does not end + in a newline, the returned text will not contain a newline.) + +RREETTUURRNN VVAALLUUEESS + Upon successful completion a pointer is returned; this pointer becomes + invalid after the next I/O operation on _s_t_r_e_a_m (whether successful or + not) or as soon as the stream is closed. Otherwise, NULL is returned. + The ffggeettlliinnee() function does not distinguish between end-of-file and er- + ror; the routines feof(3) and ferror(3) must be used to determine which + occurred. If an error occurrs, the global variable _e_r_r_n_o is set to indi- + cate the error. The end-of-file condition is remembered, even on a ter- + minal, and all subsequent attempts to read will return NULL until the + condition is cleared with clearerr(3). + + The text to which the returned pointer points may be modified, provided + that no changes are made beyond the returned size. These changes are + lost as soon as the pointer becomes invalid. + +EERRRROORRSS + [EBADF] The argument _s_t_r_e_a_m is not a stream open for reading. + + The ffggeettlliinnee() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines fflush(3), malloc(3), read(2), stat(2), or + realloc(3). + +SSEEEE AALLSSOO + ferror(3), fgets(3), fopen(3), putc(3) + +HHIISSTTOORRYY + The ffggeettlliinnee() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/fgetpos.0 b/usr/share/man/cat3/fgetpos.0 new file mode 100644 index 0000000000..bd82b24936 --- /dev/null +++ b/usr/share/man/cat3/fgetpos.0 @@ -0,0 +1,75 @@ +FSEEK(3) BSD Programmer's Manual FSEEK(3) + +NNAAMMEE + ffggeettppooss, ffsseeeekk, ffsseettppooss, fftteellll, rreewwiinndd - reposition a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffsseeeekk(_F_I_L_E _*_s_t_r_e_a_m, _l_o_n_g _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + + _l_o_n_g + fftteellll(_F_I_L_E _*_s_t_r_e_a_m); + + _v_o_i_d + rreewwiinndd(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffggeettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + + _i_n_t + ffsseettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + +DDEESSCCRRIIPPTTIIOONN + The ffsseeeekk() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m. The new position, measured in bytes, is obtained by + adding _o_f_f_s_e_t bytes to the position specified by _w_h_e_n_c_e. If _w_h_e_n_c_e is set + to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start + of the file, the current position indicator, or end-of-file, respective- + ly. A successful call to the ffsseeeekk() function clears the end-of-file in- + dicator for the stream and undoes any effects of the ungetc(3) function + on the same stream. + + The fftteellll() function obtains the current value of the file position indi- + cator for the stream pointed to by _s_t_r_e_a_m. + + The rreewwiinndd() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m to the beginning of the file. It is equivalent to: + + (void)fseek(stream, 0L, SEEK_SET) + + except that the error indicator for the stream is also cleared (see + clearerr(3)). + + The ffggeettppooss() and ffsseettppooss() functions are alternate interfaces equivalent + to fftteellll() and ffsseeeekk() (with whence set to SEEK_SET ), setting and stor- + ing the current value of the file offset into or from the object refer- + enced by _p_o_s. On some (non-UNIX) systems an ``_f_p_o_s___t'' object may be a + complex object and these routines may be the only way to portably reposi- + tion a text stream. + +RREETTUURRNN VVAALLUUEESS + The rreewwiinndd() function returns no value. Upon successful completion, + ffggeettppooss(), ffsseeeekk(), ffsseettppooss() return 0, and fftteellll() returns the current + offset. Otherwise, -1 is returned and the global variable errno is set + to indicate the error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m specified is not a seekable stream. + + [EINVAL] The _w_h_e_n_c_e argument to ffsseeeekk() was not SEEK_SET, SEEK_END, or + SEEK_CUR. + + The function ffggeettppooss(), ffsseeeekk(), ffsseettppooss(), and fftteellll() may also fail and + set _e_r_r_n_o for any of the errors specified for the routines fflush(3), + fstat(2), lseek(2), and malloc(3). + +SSEEEE AALLSSOO + lseek(2) + +SSTTAANNDDAARRDDSS + The ffggeettppooss(), ffsseettppooss(), ffsseeeekk(), fftteellll(), and rreewwiinndd() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/fgets.0 b/usr/share/man/cat3/fgets.0 new file mode 100644 index 0000000000..2d35b9c978 --- /dev/null +++ b/usr/share/man/cat3/fgets.0 @@ -0,0 +1,58 @@ +FGETS(3) BSD Programmer's Manual FGETS(3) + +NNAAMMEE + ffggeettss, ggeettss - get a line from a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ffggeettss(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _F_I_L_E _*_s_t_r_e_a_m); + + _c_h_a_r _* + ggeettss(_c_h_a_r _*_s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettss() function reads at most one less than the number of characters + specified by size from the given _s_t_r_e_a_m and stores them in the string + _s_t_r. Reading stops when a newline character is found, at end-of-file or + error. The newline, if any, is retained. In any case a `\0' character + is appended to end the string. + + The ggeettss() function is equivalent to ffggeettss() with an infinite size and a + _s_t_r_e_a_m of _s_t_d_i_n, except that the newline character (if any) is not stored + in the string. It is the caller's responsibility to ensure that the in- + put line, if any, is sufficiently short to fit in the string. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffggeettss() and ggeettss() return a pointer to the + string. If end-of-file or an error occurs before any characters are + read, they return NULL. The ffggeettss() and functions ggeettss() do not distin- + guish between end-of-file and error, and callers must use feof(3) and + ferror(3) to determine which occurred. + +EERRRROORRSS + [EBADF] The given _s_t_r_e_a_m is not a readable stream. + + The function ffggeettss() may also fail and set _e_r_r_n_o for any of the errors + specified for the routines fflush(3), fstat(2), read(2), or malloc(3). + + + The function ggeettss() may also fail and set _e_r_r_n_o for any of the errors + specified for the routine getchar(3). + +SSEEEE AALLSSOO + feof(3), ferror(3), fgetline(3) + +SSTTAANNDDAARRDDSS + The functions ffggeettss() and ggeettss() conform to ANSI C X3.159-1989 (``ANSI C + ''). + +BBUUGGSS + Since it is usually impossible to ensure that the next input line is less + than some arbitrary length, and because overflowing the input buffer is + almost invariably a security violation, programs should _N_E_V_E_R use ggeettss(). + The ggeettss() function exists purely to conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fileno.0 b/usr/share/man/cat3/fileno.0 new file mode 100644 index 0000000000..d9b2860109 --- /dev/null +++ b/usr/share/man/cat3/fileno.0 @@ -0,0 +1,47 @@ +FERROR(3) BSD Programmer's Manual FERROR(3) + +NNAAMMEE + cclleeaarreerrrr, ffeeooff, ffeerrrroorr, ffiilleennoo - check and reset stream status + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + cclleeaarreerrrr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeeooff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffeerrrroorr(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffiilleennoo(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function cclleeaarreerrrr() clears the end-of-file and error indicators for + the stream pointed to by _s_t_r_e_a_m. + + The function ffeeooff() tests the end-of-file indicator for the stream point- + ed to by _s_t_r_e_a_m, returning non-zero if it is set. The end-of-file indi- + cator can only be cleared by the function cclleeaarreerrrr(). + + The function ffeerrrroorr() tests the error indicator for the stream pointed to + by _s_t_r_e_a_m, returning non-zero if it is set. The error indicator can only + be reset by the cclleeaarreerrrr() function. + + The function ffiilleennoo() examines the argument _s_t_r_e_a_m and returns its inte- + ger desciptor. + +EERRRROORRSS + These functions should not fail and do not set the external variable + _e_r_r_n_o. + +SSEEEE AALLSSOO + open(2), stdio(3) + +SSTTAANNDDAARRDDSS + The functions cclleeaarreerrrr(), ffeeooff(), and ffeerrrroorr() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fnmatch.0 b/usr/share/man/cat3/fnmatch.0 new file mode 100644 index 0000000000..ce6c706c6a --- /dev/null +++ b/usr/share/man/cat3/fnmatch.0 @@ -0,0 +1,58 @@ +FNMATCH(3) BSD Programmer's Manual FNMATCH(3) + +NNAAMMEE + ffnnmmaattcchh - match filename or pathname + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffnnmmaattcchh(_c_o_n_s_t _c_h_a_r _*_p_a_t_t_e_r_n, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The ffnnmmaattcchh() function matches patterns according to the rules used by + the shell. It checks the string specified by the _s_t_r_i_n_g argument to see + if it matches the pattern specified by the _p_a_t_t_e_r_n argument. + + The _f_l_a_g_s argument modifies the interpretation of _p_a_t_t_e_r_n and _s_t_r_i_n_g. The + value of _f_l_a_g_s is the bitwise inclusive OR of any of the following con- + stants, which are defined in the include file _f_n_m_a_t_c_h_._h. + + FNM_NOESCAPE Normally, every occurrence of a backslash (`\') followed by + a character in _p_a_t_t_e_r_n is replaced by that character. This + is done to negate any special meaning for the character. + If the FNM_NOESCAPE flag is set, a backslash character is + treated as an ordinary character. + + FNM_PATHNAME Slash characters in _s_t_r_i_n_g must be explicitly matched by + slashes in _p_a_t_t_e_r_n. If this flag is not set, then slashes + are treated as regular characters. + + FNM_PERIOD Leading periods in strings match periods in patterns. The + definition of ``leading'' is related to the specification + of FNM_PATHNAME. A period is always ``leading'' if it is + the first character in _s_t_r_i_n_g. Additionally, if + FNM_PATHNAME is set, a period is ``leading'' if it immedi- + ately follows a slash. _T_h_i_s _f_l_a_g _i_s _n_o_t _c_u_r_r_e_n_t_l_y + _i_m_p_l_e_m_e_n_t_e_d_. + +RREETTUURRNN VVAALLUUEESS + The ffnnmmaattcchh() function returns zero if _s_t_r_i_n_g matches the pattern speci- + fied by _p_a_t_t_e_r_n, otherwise, it returns the value FNM_NOMATCH. + +SSEEEE AALLSSOO + sh(1), glob(3), wordexp(3), regexp(3) + +HHIISSTTOORRYY + The ffnnmmaattcchh() function first appeared in 4.4BSD. + +BBUUGGSS + Quotes and slashes in range patterns are not handled correctly by this + implementation. + + The FNM_PERIOD flag is not implemented. + + The pattern `*' matches the empty string, even if FNM_PATHNAME is speci- + fied. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/fopen.0 b/usr/share/man/cat3/fopen.0 new file mode 100644 index 0000000000..895c13f644 --- /dev/null +++ b/usr/share/man/cat3/fopen.0 @@ -0,0 +1,98 @@ +FOPEN(3) BSD Programmer's Manual FOPEN(3) + +NNAAMMEE + ffooppeenn, ffddooppeenn, ffrreeooppeenn - stream open functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffddooppeenn(_i_n_t _f_i_l_d_e_s, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffrreeooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates a stream with it. + + The argument _m_o_d_e points to a string beginning with one of the following + sequences (Additional characters may follow these sequences.): + + ``r'' Open text file for reading. The stream is positioned at the be- + ginning of the file. + + ``r+'' Open for reading and writing. The stream is positioned at the + beginning of the file. + + ``w'' Truncate file to zero length or create text file for writing. + The stream is positioned at the beginning of the file. It ``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. + + ``a'' Open for writing. The file is created if it does not exist. The + stream is positioned at the end of the file. + + ``a+'' Open for reading and writing. The file is created if it does not + exist. The stream is positioned at the end of the file. + + The _m_o_d_e string can also include the letter ``b'' either as a third char- + acter or as a character between the characters in any of the two- + character strings described above. This is strictly for compatibility + with ANSI C X3.159-1989 (``ANSI C '') and has no effect; the ``b'' is ig- + nored. + + Any created files will have mode "S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | + S_IROTH | S_IWOTH" (0666), as modified by the process' umask value (see + umask(2)). + + Reads and writes may be intermixed on read/write streams in any order, + and do not require an intermediate seek as in previous versions of _s_t_d_i_o. + This is not portable to other systems, however; ANSI C requires that a + file positioning function intervene between output and input, unless an + input operation encounters end-of-file. + + The ffddooppeenn() function associates a stream with the existing file descrip- + tor, _f_i_l_d_e_s. The _m_o_d_e of the stream must be compatible with the mode of + the file descriptor. + + The ffrreeooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates the stream pointed to by _s_t_r_e_a_m with it. The + original stream (if it exists) is closed. The _m_o_d_e argument is used just + as in the fopen function. The primary use of the ffrreeooppeenn() function is + to change the file associated with a standard text stream (_s_t_d_e_r_r, _s_t_d_i_n, + or _s_t_d_o_u_t). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() return a FILE + pointer. Otherwise, NULL is returned and the global variable _e_r_r_n_o is + set to indicate the error. + +EERRRROORRSS + [EINVAL] The _m_o_d_e provided to ffooppeenn(), ffddooppeenn(), or ffrreeooppeenn() was in- + valid. + + The ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() functions may also fail and set _e_r_r_n_o + for any of the errors specified for the routine malloc(3). + + The ffooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine open(2). + + The ffddooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine fcntl(2). + + The ffrreeooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines open(2), fclose(3) and fflush(3). + +SSEEEE AALLSSOO + open(2), fclose(3), fseek(3), funopen(3) + +SSTTAANNDDAARRDDSS + The ffooppeenn() and ffrreeooppeenn() functions conform to ANSI C X3.159-1989 (``ANSI + C ''). The ffddooppeenn() function conforms to IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/fprintf.0 b/usr/share/man/cat3/fprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/fprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/fpurge.0 b/usr/share/man/cat3/fpurge.0 new file mode 100644 index 0000000000..e516d56138 --- /dev/null +++ b/usr/share/man/cat3/fpurge.0 @@ -0,0 +1,45 @@ +FFLUSH(3) BSD Programmer's Manual FFLUSH(3) + +NNAAMMEE + fffflluusshh, ffppuurrggee - flush a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + fffflluusshh(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffppuurrggee(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function fffflluusshh() forces a write of all buffered data for the given + output or update _s_t_r_e_a_m via the stream's underlying write function. The + open status of the stream is unaffected. + + If the _s_t_r_e_a_m argument is NULL, fffflluusshh() flushes _a_l_l open output streams. + + The function ffppuurrggee() erases any input or output buffered in the given + _s_t_r_e_a_m. 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 getc(3); this includes any text pushed back via ungetc. + + +RREETTUURRNN VVAALLUUEESS + Upon successful completion 0 is returned. Otherwise, EOF is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + [EBADF] _S_t_r_e_a_m is not an open stream, or, in the case of fffflluusshh(), not a + stream open for writing. + + The function fffflluusshh() may also fail and set _e_r_r_n_o for any of the errors + specified for the routine write(2). + +SSEEEE AALLSSOO + write(2), fopen(3), fclose(3), setbuf(3) + +SSTTAANNDDAARRDDSS + The fffflluusshh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fputc.0 b/usr/share/man/cat3/fputc.0 new file mode 100644 index 0000000000..2d3750b7a4 --- /dev/null +++ b/usr/share/man/cat3/fputc.0 @@ -0,0 +1,51 @@ +PUTC(3) BSD Programmer's Manual PUTC(3) + +NNAAMMEE + ffppuuttcc, ppuuttcc, ppuuttcchhaarr, ppuuttww - output a character or word to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcchhaarr(_i_n_t _c); + + _i_n_t + ppuuttww(_i_n_t _w, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffppuuttcc() function writes the character _c (converted to an ``unsigned + char'') to the output stream pointed to by _s_t_r_e_a_m. + + PPuuttcc() acts essentially identically to ffppuuttcc(), but is a macro that ex- + pands in-line. It may evaluate _s_t_r_e_a_m more than once, so arguments given + to ppuuttcc() should not be expressions with potential side effects. + + PPuuttcchhaarr() is identical to ppuuttcc() with an output stream of _s_t_d_o_u_t. + + The ppuuttww() function writes the specified _i_n_t to the named output _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + The functions, ffppuuttcc(), ppuuttcc() and ppuuttcchhaarr() return the character writ- + ten. If an error occurs, the value EOF is returned. The ppuuttww() function + returns 0 on success; EOF is returned if a write error occurs, or if an + attempt is made to write a read-only stream. + +SSEEEE AALLSSOO + ferror(3), fopen(3), getc(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttcc(), ppuuttcc(), and ppuuttcchhaarr(), conform to ANSI C + X3.159-1989 (``ANSI C ''). A function ppuuttww() function appeared in Version + 6 AT&T UNIX. + +BBUUGGSS + The size and byte order of an _i_n_t varies from one machine to another, and + ppuuttww() is not recommended for portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fputs.0 b/usr/share/man/cat3/fputs.0 new file mode 100644 index 0000000000..7636389af2 --- /dev/null +++ b/usr/share/man/cat3/fputs.0 @@ -0,0 +1,39 @@ +FPUTS(3) BSD Programmer's Manual FPUTS(3) + +NNAAMMEE + ffppuuttss, ppuuttss - output a line to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttss(_c_o_n_s_t _c_h_a_r _*_s_t_r, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttss(_c_o_n_s_t _c_h_a_r _*_s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The function ffppuuttss() writes the string pointed to by _s_t_r to the stream + pointed to by _s_t_r_e_a_m. + + The function ppuuttss() writes the string _s_t_r, and a terminating newline + character, to the stream _s_t_d_o_u_t. + +RREETTUURRNN VVAALLUUEESS + The ffppuuttss() function returns 0 on success and EOF on error; ppuuttss() re- + turns a nonnegative integer on success and EOF on error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m supplied is not a writable stream. + + The functions ffppuuttss() and ppuuttss() may also fail and set _e_r_r_n_o for any of + the errors specified for the routines write(2). + +SSEEEE AALLSSOO + putc(3), ferror(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttss() and ppuuttss() conform to ANSI C X3.159-1989 (``ANSI C + ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fread.0 b/usr/share/man/cat3/fread.0 new file mode 100644 index 0000000000..2241c4a308 --- /dev/null +++ b/usr/share/man/cat3/fread.0 @@ -0,0 +1,41 @@ +FREAD(3) BSD Programmer's Manual FREAD(3) + +NNAAMMEE + ffrreeaadd, ffwwrriittee - binary stream input/output + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffrreeaadd(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e, _s_i_z_e___t _n_m_e_m_b, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffwwrriittee(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e, _s_i_z_e___t _n_m_e_m_b, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function ffrreeaadd() reads _n_m_e_m_b objects, each size bytes long, from the + stream pointed to by _s_t_r_e_a_m, storing them at the location given by _p_t_r. + + The function ffwwrriittee() writes _n_m_e_m_b objects, each _s_i_z_e bytes long, to the + stream pointed to by _s_t_r_e_a_m, obtaining them from the location given by + _p_t_r. + +RREETTUURRNN VVAALLUUEESS + The functions ffrreeaadd() and ffwwrriittee() advance the file position indicator + for the stream by the number of bytes read or written. They return the + number of objects read or written. If an error occurs, or the end-of- + file is reached, the return value is a short object count (or zero). + + The function ffrreeaadd() does not distinguish between end-of-file and error, + and callers must use feof(3) and ferror(3) to determine which occurred. + The function ffwwrriittee() returns a value less than _n_m_e_m_b only if a write er- + ror has occurred. + +SSEEEE AALLSSOO + read(2), write(2) + +SSTTAANNDDAARRDDSS + The functions ffrreeaadd() and ffwwrriittee() conform to ANSI C X3.159-1989 (``ANSI + C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/free.0 b/usr/share/man/cat3/free.0 new file mode 100644 index 0000000000..97c2cffaaf --- /dev/null +++ b/usr/share/man/cat3/free.0 @@ -0,0 +1,29 @@ +FREE(3) BSD Programmer's Manual FREE(3) + +NNAAMMEE + ffrreeee - free up memory allocated with malloc, calloc or realloc + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ffrreeee(_v_o_i_d _*_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ffrreeee() function causes the space pointed to by _p_t_r to be deallocated, + that is, made available for further allocation. If _p_t_r is a null point- + er, no action occurs. Otherwise, if the argument does not match a point- + er earlier returned by the calloc, malloc, or realloc function, or if + the space has been deallocated by a call to ffrreeee() or realloc, general + havoc may occur. + +RREETTUURRNN VVAALLUUEESS + The ffrreeee() function returns no value. + +SSEEEE AALLSSOO + calloc(3), malloc(3), realloc(3) + +SSTTAANNDDAARRDDSS + The ffrreeee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/freopen.0 b/usr/share/man/cat3/freopen.0 new file mode 100644 index 0000000000..895c13f644 --- /dev/null +++ b/usr/share/man/cat3/freopen.0 @@ -0,0 +1,98 @@ +FOPEN(3) BSD Programmer's Manual FOPEN(3) + +NNAAMMEE + ffooppeenn, ffddooppeenn, ffrreeooppeenn - stream open functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffddooppeenn(_i_n_t _f_i_l_d_e_s, _c_h_a_r _*_m_o_d_e); + + _F_I_L_E _* + ffrreeooppeenn(_c_h_a_r _*_p_a_t_h, _c_h_a_r _*_m_o_d_e, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates a stream with it. + + The argument _m_o_d_e points to a string beginning with one of the following + sequences (Additional characters may follow these sequences.): + + ``r'' Open text file for reading. The stream is positioned at the be- + ginning of the file. + + ``r+'' Open for reading and writing. The stream is positioned at the + beginning of the file. + + ``w'' Truncate file to zero length or create text file for writing. + The stream is positioned at the beginning of the file. It ``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. + + ``a'' Open for writing. The file is created if it does not exist. The + stream is positioned at the end of the file. + + ``a+'' Open for reading and writing. The file is created if it does not + exist. The stream is positioned at the end of the file. + + The _m_o_d_e string can also include the letter ``b'' either as a third char- + acter or as a character between the characters in any of the two- + character strings described above. This is strictly for compatibility + with ANSI C X3.159-1989 (``ANSI C '') and has no effect; the ``b'' is ig- + nored. + + Any created files will have mode "S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | + S_IROTH | S_IWOTH" (0666), as modified by the process' umask value (see + umask(2)). + + Reads and writes may be intermixed on read/write streams in any order, + and do not require an intermediate seek as in previous versions of _s_t_d_i_o. + This is not portable to other systems, however; ANSI C requires that a + file positioning function intervene between output and input, unless an + input operation encounters end-of-file. + + The ffddooppeenn() function associates a stream with the existing file descrip- + tor, _f_i_l_d_e_s. The _m_o_d_e of the stream must be compatible with the mode of + the file descriptor. + + The ffrreeooppeenn() function opens the file whose name is the string pointed to + by _p_a_t_h and associates the stream pointed to by _s_t_r_e_a_m with it. The + original stream (if it exists) is closed. The _m_o_d_e argument is used just + as in the fopen function. The primary use of the ffrreeooppeenn() function is + to change the file associated with a standard text stream (_s_t_d_e_r_r, _s_t_d_i_n, + or _s_t_d_o_u_t). + +RREETTUURRNN VVAALLUUEESS + Upon successful completion ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() return a FILE + pointer. Otherwise, NULL is returned and the global variable _e_r_r_n_o is + set to indicate the error. + +EERRRROORRSS + [EINVAL] The _m_o_d_e provided to ffooppeenn(), ffddooppeenn(), or ffrreeooppeenn() was in- + valid. + + The ffooppeenn(), ffddooppeenn() and ffrreeooppeenn() functions may also fail and set _e_r_r_n_o + for any of the errors specified for the routine malloc(3). + + The ffooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine open(2). + + The ffddooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routine fcntl(2). + + The ffrreeooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines open(2), fclose(3) and fflush(3). + +SSEEEE AALLSSOO + open(2), fclose(3), fseek(3), funopen(3) + +SSTTAANNDDAARRDDSS + The ffooppeenn() and ffrreeooppeenn() functions conform to ANSI C X3.159-1989 (``ANSI + C ''). The ffddooppeenn() function conforms to IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/frexp.0 b/usr/share/man/cat3/frexp.0 new file mode 100644 index 0000000000..4becbcadeb --- /dev/null +++ b/usr/share/man/cat3/frexp.0 @@ -0,0 +1,30 @@ +FREXP(3) BSD Programmer's Manual FREXP(3) + +NNAAMMEE + ffrreexxpp - convert floating-point number to fractional and integral compo- + nents + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ffrreexxpp(_d_o_u_b_l_e _v_a_l_u_e, _i_n_t _*_e_x_p); + +DDEESSCCRRIIPPTTIIOONN + The ffrreexxpp() function breaks a floating-point number into a normalized + fraction and an integral power of 2. It stores the integer in the _i_n_t + object pointed to by _e_x_p. + +RREETTUURRNN VVAALLUUEESS + The ffrreexxpp() function returns the value _x, such that _x is a _d_o_u_b_l_e with + magnitude in the interval [1/2, 1] or zero, and _v_a_l_u_e equals _x times 2 + raised to the power _*_e_x_p. If _v_a_l_u_e is zero, both parts of the result are + zero. + +SSEEEE AALLSSOO + ldexp(3), modf(3), math(3) + +SSTTAANNDDAARRDDSS + The ffrreexxpp() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/fropen.0 b/usr/share/man/cat3/fropen.0 new file mode 100644 index 0000000000..05eca5891a --- /dev/null +++ b/usr/share/man/cat3/fropen.0 @@ -0,0 +1,74 @@ +FUNOPEN(3) BSD Programmer's Manual FUNOPEN(3) + +NNAAMMEE + ffuunnooppeenn, ffrrooppeenn, ffwwooppeenn - open a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffuunnooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_), + _i_n_t _(_w_r_i_t_e_f_n_*_)_(_v_o_i_d _*_, _c_o_n_s_t _c_h_a_r _*_, _i_n_t_), + _f_p_o_s___t _(_s_e_e_k_f_n_*_)_(_v_o_i_d _*_, _f_p_o_s___t_, _i_n_t_), _i_n_t _(_c_l_o_s_e_f_n_*_)_(_v_o_i_d _*_)); + + _F_I_L_E _* + ffrrooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + + _F_I_L_E _* + ffwwooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_w_r_i_t_e_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + +DDEESSCCRRIIPPTTIIOONN + The ffuunnooppeenn() function associates a stream with up to four ``I/O + functions''. Either _r_e_a_d_f_n or _w_r_i_t_e_f_n must be specified; the others can + be given as an appropriately-typed NULL pointer. These I/O functions + will be used to read, write, seek and close the new stream. + + In general, omitting a function means that any attempt to perform the as- + sociated operation on the resulting stream will fail. If the close func- + tion is omitted, closing the stream will flush any buffered output and + then succeed. + + The calling conventions of _r_e_a_d_f_n, _w_r_i_t_e_f_n, _s_e_e_k_f_n and _c_l_o_s_e_f_n must match + those, respectively, of read(2), write(2), seek(2), and close(2) with + the single exception that they are passed the _c_o_o_k_i_e argument specified + to ffuunnooppeenn() in place of the traditional file descriptor argument. + + Read and write I/O functions are allowed to change the underlying buffer + on fully buffered or line buffered streams by calling setvbuf(3). They + are also not required to completely fill or empty the buffer. They are + not, however, allowed to change streams from unbuffered to buffered or to + change the state of the line buffering flag. They must also be prepared + to have read or write calls occur on buffers other than the one most re- + cently specified. + + All user I/O functions can report an error by returning -1. Additional- + ly, all of the functions should set the external variable _e_r_r_n_o appropri- + ately if an error occurs. + + An error on cclloosseeffnn() does not keep the stream open. + + As a convenience, the include file <_s_t_d_i_o_._h> defines the macros ffrrooppeenn() + and ffwwooppeenn() as calls to ffuunnooppeenn() with only a read or write function + specified. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffuunnooppeenn() returns a FILE pointer. Otherwise, + NULL is returned and the global variable _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + [EINVAL] The ffuunnooppeenn() function was called without either a read or + write function. The ffuunnooppeenn() function may also fail and set + _e_r_r_n_o for any of the errors specified for the routine + malloc(3). + +SSEEEE AALLSSOO + fcntl(2), open(2), fclose(3), fopen(3), fseek(3), setbuf(3) + +HHIISSTTOORRYY + The ffuunnooppeenn() functions first appeared in 4.4BSD. + +BBUUGGSS + The ffuunnooppeenn() function may not be portable to systems other than BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/fscanf.0 b/usr/share/man/cat3/fscanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/fscanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/fseek.0 b/usr/share/man/cat3/fseek.0 new file mode 100644 index 0000000000..bd82b24936 --- /dev/null +++ b/usr/share/man/cat3/fseek.0 @@ -0,0 +1,75 @@ +FSEEK(3) BSD Programmer's Manual FSEEK(3) + +NNAAMMEE + ffggeettppooss, ffsseeeekk, ffsseettppooss, fftteellll, rreewwiinndd - reposition a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffsseeeekk(_F_I_L_E _*_s_t_r_e_a_m, _l_o_n_g _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + + _l_o_n_g + fftteellll(_F_I_L_E _*_s_t_r_e_a_m); + + _v_o_i_d + rreewwiinndd(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffggeettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + + _i_n_t + ffsseettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + +DDEESSCCRRIIPPTTIIOONN + The ffsseeeekk() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m. The new position, measured in bytes, is obtained by + adding _o_f_f_s_e_t bytes to the position specified by _w_h_e_n_c_e. If _w_h_e_n_c_e is set + to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start + of the file, the current position indicator, or end-of-file, respective- + ly. A successful call to the ffsseeeekk() function clears the end-of-file in- + dicator for the stream and undoes any effects of the ungetc(3) function + on the same stream. + + The fftteellll() function obtains the current value of the file position indi- + cator for the stream pointed to by _s_t_r_e_a_m. + + The rreewwiinndd() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m to the beginning of the file. It is equivalent to: + + (void)fseek(stream, 0L, SEEK_SET) + + except that the error indicator for the stream is also cleared (see + clearerr(3)). + + The ffggeettppooss() and ffsseettppooss() functions are alternate interfaces equivalent + to fftteellll() and ffsseeeekk() (with whence set to SEEK_SET ), setting and stor- + ing the current value of the file offset into or from the object refer- + enced by _p_o_s. On some (non-UNIX) systems an ``_f_p_o_s___t'' object may be a + complex object and these routines may be the only way to portably reposi- + tion a text stream. + +RREETTUURRNN VVAALLUUEESS + The rreewwiinndd() function returns no value. Upon successful completion, + ffggeettppooss(), ffsseeeekk(), ffsseettppooss() return 0, and fftteellll() returns the current + offset. Otherwise, -1 is returned and the global variable errno is set + to indicate the error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m specified is not a seekable stream. + + [EINVAL] The _w_h_e_n_c_e argument to ffsseeeekk() was not SEEK_SET, SEEK_END, or + SEEK_CUR. + + The function ffggeettppooss(), ffsseeeekk(), ffsseettppooss(), and fftteellll() may also fail and + set _e_r_r_n_o for any of the errors specified for the routines fflush(3), + fstat(2), lseek(2), and malloc(3). + +SSEEEE AALLSSOO + lseek(2) + +SSTTAANNDDAARRDDSS + The ffggeettppooss(), ffsseettppooss(), ffsseeeekk(), fftteellll(), and rreewwiinndd() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/fsetpos.0 b/usr/share/man/cat3/fsetpos.0 new file mode 100644 index 0000000000..bd82b24936 --- /dev/null +++ b/usr/share/man/cat3/fsetpos.0 @@ -0,0 +1,75 @@ +FSEEK(3) BSD Programmer's Manual FSEEK(3) + +NNAAMMEE + ffggeettppooss, ffsseeeekk, ffsseettppooss, fftteellll, rreewwiinndd - reposition a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffsseeeekk(_F_I_L_E _*_s_t_r_e_a_m, _l_o_n_g _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + + _l_o_n_g + fftteellll(_F_I_L_E _*_s_t_r_e_a_m); + + _v_o_i_d + rreewwiinndd(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffggeettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + + _i_n_t + ffsseettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + +DDEESSCCRRIIPPTTIIOONN + The ffsseeeekk() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m. The new position, measured in bytes, is obtained by + adding _o_f_f_s_e_t bytes to the position specified by _w_h_e_n_c_e. If _w_h_e_n_c_e is set + to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start + of the file, the current position indicator, or end-of-file, respective- + ly. A successful call to the ffsseeeekk() function clears the end-of-file in- + dicator for the stream and undoes any effects of the ungetc(3) function + on the same stream. + + The fftteellll() function obtains the current value of the file position indi- + cator for the stream pointed to by _s_t_r_e_a_m. + + The rreewwiinndd() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m to the beginning of the file. It is equivalent to: + + (void)fseek(stream, 0L, SEEK_SET) + + except that the error indicator for the stream is also cleared (see + clearerr(3)). + + The ffggeettppooss() and ffsseettppooss() functions are alternate interfaces equivalent + to fftteellll() and ffsseeeekk() (with whence set to SEEK_SET ), setting and stor- + ing the current value of the file offset into or from the object refer- + enced by _p_o_s. On some (non-UNIX) systems an ``_f_p_o_s___t'' object may be a + complex object and these routines may be the only way to portably reposi- + tion a text stream. + +RREETTUURRNN VVAALLUUEESS + The rreewwiinndd() function returns no value. Upon successful completion, + ffggeettppooss(), ffsseeeekk(), ffsseettppooss() return 0, and fftteellll() returns the current + offset. Otherwise, -1 is returned and the global variable errno is set + to indicate the error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m specified is not a seekable stream. + + [EINVAL] The _w_h_e_n_c_e argument to ffsseeeekk() was not SEEK_SET, SEEK_END, or + SEEK_CUR. + + The function ffggeettppooss(), ffsseeeekk(), ffsseettppooss(), and fftteellll() may also fail and + set _e_r_r_n_o for any of the errors specified for the routines fflush(3), + fstat(2), lseek(2), and malloc(3). + +SSEEEE AALLSSOO + lseek(2) + +SSTTAANNDDAARRDDSS + The ffggeettppooss(), ffsseettppooss(), ffsseeeekk(), fftteellll(), and rreewwiinndd() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/ftell.0 b/usr/share/man/cat3/ftell.0 new file mode 100644 index 0000000000..bd82b24936 --- /dev/null +++ b/usr/share/man/cat3/ftell.0 @@ -0,0 +1,75 @@ +FSEEK(3) BSD Programmer's Manual FSEEK(3) + +NNAAMMEE + ffggeettppooss, ffsseeeekk, ffsseettppooss, fftteellll, rreewwiinndd - reposition a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffsseeeekk(_F_I_L_E _*_s_t_r_e_a_m, _l_o_n_g _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + + _l_o_n_g + fftteellll(_F_I_L_E _*_s_t_r_e_a_m); + + _v_o_i_d + rreewwiinndd(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffggeettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + + _i_n_t + ffsseettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + +DDEESSCCRRIIPPTTIIOONN + The ffsseeeekk() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m. The new position, measured in bytes, is obtained by + adding _o_f_f_s_e_t bytes to the position specified by _w_h_e_n_c_e. If _w_h_e_n_c_e is set + to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start + of the file, the current position indicator, or end-of-file, respective- + ly. A successful call to the ffsseeeekk() function clears the end-of-file in- + dicator for the stream and undoes any effects of the ungetc(3) function + on the same stream. + + The fftteellll() function obtains the current value of the file position indi- + cator for the stream pointed to by _s_t_r_e_a_m. + + The rreewwiinndd() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m to the beginning of the file. It is equivalent to: + + (void)fseek(stream, 0L, SEEK_SET) + + except that the error indicator for the stream is also cleared (see + clearerr(3)). + + The ffggeettppooss() and ffsseettppooss() functions are alternate interfaces equivalent + to fftteellll() and ffsseeeekk() (with whence set to SEEK_SET ), setting and stor- + ing the current value of the file offset into or from the object refer- + enced by _p_o_s. On some (non-UNIX) systems an ``_f_p_o_s___t'' object may be a + complex object and these routines may be the only way to portably reposi- + tion a text stream. + +RREETTUURRNN VVAALLUUEESS + The rreewwiinndd() function returns no value. Upon successful completion, + ffggeettppooss(), ffsseeeekk(), ffsseettppooss() return 0, and fftteellll() returns the current + offset. Otherwise, -1 is returned and the global variable errno is set + to indicate the error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m specified is not a seekable stream. + + [EINVAL] The _w_h_e_n_c_e argument to ffsseeeekk() was not SEEK_SET, SEEK_END, or + SEEK_CUR. + + The function ffggeettppooss(), ffsseeeekk(), ffsseettppooss(), and fftteellll() may also fail and + set _e_r_r_n_o for any of the errors specified for the routines fflush(3), + fstat(2), lseek(2), and malloc(3). + +SSEEEE AALLSSOO + lseek(2) + +SSTTAANNDDAARRDDSS + The ffggeettppooss(), ffsseettppooss(), ffsseeeekk(), fftteellll(), and rreewwiinndd() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/fts.0 b/usr/share/man/cat3/fts.0 new file mode 100644 index 0000000000..8ecf87633b --- /dev/null +++ b/usr/share/man/cat3/fts.0 @@ -0,0 +1,374 @@ +FTS(3) BSD Programmer's Manual FTS(3) + +NNAAMMEE + ffttss - traverse a file hierarchy + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _F_T_S _* + ffttss__ooppeenn(_c_h_a_r _* _c_o_n_s_t _*_p_a_t_h___a_r_g_v, _i_n_t _o_p_t_i_o_n_s, + _i_n_t _*_c_o_m_p_a_r_(_c_o_n_s_t _F_T_S_E_N_T _*_*_, _c_o_n_s_t _F_T_S_E_N_T _*_*_)); + + _F_T_S_E_N_T _* + ffttss__rreeaadd(_F_T_S _*_f_t_s_p); + + _F_T_S_E_N_T _* + ffttss__cchhiillddrreenn(_F_T_S _*_f_t_s_p, _i_n_t _o_p_t_i_o_n_s); + + _i_n_t + ffttss__sseett(_F_T_S _f_t_s_p, _F_T_S_E_N_T _*_f, _i_n_t _o_p_t_i_o_n_s); + + _i_n_t + ffttss__cclloossee(_F_T_S _*_f_t_s_p); + +DDEESSCCRRIIPPTTIIOONN + The ffttss functions are provided for traversing UNIX file hierarchies. A + simple overview is that the ffttss__ooppeenn() function returns a ``handle'' on a + file hierarchy, which is then supplied to the other ffttss functions. The + function ffttss__rreeaadd() returns a pointer to a structure describing one of + the files in the file hierarchy. The function ffttss__cchhiillddrreenn() 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, direc- + tories are visited two distinguishable times; in pre-order (before any of + their descendants are visited) and in post-order (after all of their de- + scendants 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 re-visit portions of the hierarchy. + + Two structures are defined (and typedef'd) in the include file <_f_t_s_._h>. + The first is _F_T_S, the structure that represents the file hierarchy it- + self. The second is _F_T_S_E_N_T, the structure that represents a file in the + file hierarchy. Normally, an _F_T_S_E_N_T structure is returned for every file + in the file hierarchy. In this manual page, ``file'' and ``_F_T_S_E_N_T + structure'' are generally interchangeable. The _F_T_S_E_N_T structure contains + at least the following fields, which are described in greater detail be- + low: + + typedef struct _ftsent { + u_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; /* file name */ + short fts_namelen; /* strlen(fts_name) */ + short fts_level; /* depth (-1 to N) */ + int fts_error; /* 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; + + These fields are defined as follows: + + _f_t_s___i_n_f_o One of the following flags describing the returned _F_T_S_E_N_T + structure and the file it represents. With the exception of + directories without errors (FTS_D), all of these entries are + terminal, that is, they will not be revisited, nor will any + of their descendants be visited. + + FTS_D A directory being visited in pre-order. + + FTS_DC A directory that causes a cycle in the tree. + (The _f_t_s___c_y_c_l_e field of the _F_T_S_E_N_T structure + will be filled in as well.) + + FTS_DEFAULT Any _F_T_S_E_N_T structure that represents a file + type not explicitly described by one of the + other _f_t_s___i_n_f_o values. + + FTS_DNR A directory which cannot be read. This is an + error return, and the _f_t_s___e_r_r_n_o field will be + set to indicate what caused the error. + + FTS_DOT A file named `.' or `..' which was not speci- + fied as a file name to ffttss__ooppeenn() (see + FTS_SEEDOT). + + FTS_DP A directory being visited in post-order. The + contents of the _F_T_S_E_N_T structure will be un- + changed from when it was returned in pre-order, + i.e. with the _f_t_s___i_n_f_o field set to FTS_D. + + FTS_ERR This is an error return, and the _f_t_s___e_r_r_n_o + field will be set to indicate what caused the + error. + + FTS_F A regular file. + + FTS_NS A file for which no stat(2) information was + available. The contents of the _f_t_s___s_t_a_t_p field + are undefined. This is an error return, and + the _f_t_s___e_r_r_n_o field will be set to indicate + what caused the error. + + FTS_NSOK A file for which no stat(2) information was re- + quested. The contents of the _f_t_s___s_t_a_t_p field + are undefined. + + FTS_SL A symbolic link. + + FTS_SLNONE A symbolic link with a non-existent target. + The contents of the _f_t_s___s_t_a_t_p field reference + the file characteristic information for the + symbolic link itself. + + _f_t_s___a_c_c_p_a_t_h A path for accessing the file from the current directory. + + _f_t_s___p_a_t_h The path for the file relative to the root of the traversal. + This path contains the path specified to ffttss__ooppeenn() as a + prefix. + + _f_t_s___p_a_t_h_l_e_n The length of the string referenced by _f_t_s___p_a_t_h. + + + + _f_t_s___n_a_m_e The name of the file. + + _f_t_s___n_a_m_e_l_e_n The length of the string referenced by _f_t_s___n_a_m_e. + + _f_t_s___l_e_v_e_l The depth of the traversal, numbered from -1 to N, where + this file was found. The _F_T_S_E_N_T structure representing the + parent of the starting point (or root) of the traversal is + numbered -1, and the _F_T_S_E_N_T structure for the root itself is + numbered 0. + + _f_t_s___e_r_r_n_o Upon return of a _F_T_S_E_N_T structure from the ffttss__cchhiillddrreenn() or + ffttss__rreeaadd() functions, with its _f_t_s___i_n_f_o field set to + FTS_DNR, FTS_ERR or FTS_NS, the _f_t_s___e_r_r_n_o field contains the + value of the external variable _e_r_r_n_o specifying the cause of + the error. Otherwise, the contents of the _f_t_s___e_r_r_n_o field + are undefined. + + _f_t_s___n_u_m_b_e_r This field is provided for the use of the application pro- + gram and is not modified by the ffttss functions. It is ini- + tialized to 0. + + _f_t_s___p_o_i_n_t_e_r This field is provided for the use of the application pro- + gram and is not modified by the ffttss functions. It is ini- + tialized to NULL. + + _f_t_s___p_a_r_e_n_t A pointer to the _F_T_S_E_N_T structure referencing the file in + the hierarchy immediately above the current file, i.e. the + directory of which this file is a member. A parent struc- + ture for the initial entry point is provided as well, howev- + er, only the _f_t_s___l_e_v_e_l, _f_t_s___n_u_m_b_e_r and _f_t_s___p_o_i_n_t_e_r fields + are guaranteed to be initialized. + + _f_t_s___l_i_n_k Upon return from the ffttss__cchhiillddrreenn() function, the _f_t_s___l_i_n_k + field points to the next structure in the NULL-terminated + linked list of directory members. Otherwise, the contents + of the _f_t_s___l_i_n_k field are undefined. + + _f_t_s___c_y_c_l_e If a directory causes a cycle in the hierarchy (see FTS_DC), + either because of a hard link between two directories, or a + symbolic link pointing to a directory, the _f_t_s___c_y_c_l_e field + of the structure will point to the _F_T_S_E_N_T structure in the + hierarchy that references the same file as the current + _F_T_S_E_N_T structure. Otherwise, the contents of the _f_t_s___c_y_c_l_e + field are undefined. + + _f_t_s___s_t_a_t_p A pointer to stat(2) information for the file. + + A single buffer is used for all of the paths of all of the files in the + file hierarchy. Therefore, the _f_t_s___p_a_t_h and _f_t_s___a_c_c_p_a_t_h fields are guar- + anteed to be NULL-terminated _o_n_l_y for the file most recently returned by + ffttss__rreeaadd(). To use these fields to reference any files represented by + other _F_T_S_E_N_T structures will require that the path buffer be modified us- + ing the information contained in that _F_T_S_E_N_T structure's _f_t_s___p_a_t_h_l_e_n + field. Any such modifications should be undone before further calls to + ffttss__rreeaadd() are attempted. The _f_t_s___n_a_m_e field is always NULL-terminated. + +FFTTSS__OOPPEENN + The ffttss__ooppeenn() 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. + + There are a number of options, at least one of which (either FTS_LOGICAL + or FTS_PHYSICAL) must be specified. The options are selected by _o_r'ing + the following values: + + FTS_COMFOLLOW + This option causes any symbolic link specified as a root + path to be followed immediately whether or not FTS_LOGICAL + is also specified. + + FTS_LOGICAL This option causes the ffttss routines to return _F_T_S_E_N_T struc- + tures for the targets of symbolic links instead of the sym- + bolic links themselves. If this option is set, the only + symbolic links for which _F_T_S_E_N_T structures are returned to + the application are those referencing non-existent files. + Either FTS_LOGICAL or FTS_PHYSICAL _m_u_s_t be provided to the + ffttss__ooppeenn() function. + + FTS_NOCHDIR As a performance optimization, the ffttss functions change di- + rectories 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 FTS_NOCHDIR + option turns off this optimization, and the ffttss functions + will not change the current directory. Note that applica- + tions should not themselves change their current directory + and try to access files unless FTS_NOCHDIR is specified and + absolute pathnames were provided as arguments to + ffttss__ooppeenn(). + + FTS_NOSTAT By default, returned _F_T_S_E_N_T structures reference file char- + acteristic information (the _s_t_a_t_p field) for each file vis- + ited. This option relaxes that requirement as a perfor- + mance optimization, allowing the ffttss functions to set the + _f_t_s___i_n_f_o field to FTS_NSOK and leave the contents of the + _s_t_a_t_p field undefined. + + FTS_PHYSICAL This option causes the ffttss routines to return _F_T_S_E_N_T struc- + tures for symbolic links themselves instead of the target + files they point to. If this option is set, _F_T_S_E_N_T struc- + tures for all symbolic links in the hierarchy are returned + to the application. Either FTS_LOGICAL or FTS_PHYSICAL + _m_u_s_t be provided to the ffttss__ooppeenn() function. + + FTS_SEEDOT By default, unless they are specified as path arguments to + ffttss__ooppeenn(), any files named `.' or `..' encountered in the + file hierarchy are ignored. This option causes the ffttss + routines to return _F_T_S_E_N_T structures for them. + + FTS_XDEV This option prevents ffttss from descending into directories + that have a different device number than the file from + which the descent began. + + The argument ccoommppaarr() specifies a user-defined function which may be used + to order the traversal of the hierarchy. It takes two pointers to point- + ers to _F_T_S_E_N_T 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 _f_t_s___a_c_c_p_a_t_h, _f_t_s___p_a_t_h and + _f_t_s___p_a_t_h_l_e_n fields of the _F_T_S_E_N_T structures may _n_e_v_e_r be used in this + comparison. If the _f_t_s___i_n_f_o field is set to FTS_NS or FTS_NSOK, the + _f_t_s___s_t_a_t_p field may not either. If the ccoommppaarr() argument is NULL, the + directory traversal order is in the order listed in _p_a_t_h___a_r_g_v for the + root paths, and in the order listed in the directory for everything else. + +FFTTSS__RREEAADD + The ffttss__rreeaadd() function returns a pointer to an _F_T_S_E_N_T structure describ- + ing a file in the hierarchy. Directories (that are readable and do not + cause cycles) are visited at least twice, once in pre-order and once in + post-order. All other files are visited at least once. (Hard links be- + tween 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.) + + If all the members of the hierarchy have been returned, ffttss__rreeaadd() re- + turns NULL and sets the external variable _e_r_r_n_o to 0. If an error unre- + lated to a file in the hierarchy occurs, ffttss__rreeaadd() returns NULL and sets + _e_r_r_n_o appropriately. If an error related to a returned file occurs, a + pointer to an _F_T_S_E_N_T structure is returned, and _e_r_r_n_o may or may not have + been set (see _f_t_s___i_n_f_o). + + The _F_T_S_E_N_T structures returned by ffttss__rreeaadd() may be overwritten after a + call to ffttss__cclloossee() on the same file hierarchy stream, or, after a call + to ffttss__rreeaadd() 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 ffttss__rreeaadd() after the _F_T_S_E_N_T structure has been returned + by the function ffttss__rreeaadd() in post-order. + +FFTTSS__CCHHIILLDDRREENN + The ffttss__cchhiillddrreenn() function returns a pointer to an _F_T_S_E_N_T structure de- + scribing the first entry in a NULL-terminated linked list of the files in + the directory represented by the _F_T_S_E_N_T structure most recently returned + by ffttss__rreeaadd(). The list is linked through the _f_t_s___l_i_n_k field of the + _F_T_S_E_N_T structure, and is ordered by the user-specified comparison func- + tion, if any. Repeated calls to ffttss__cchhiillddrreenn() will recreate this linked + list. + + As a special case, if ffttss__rreeaadd() has not yet been called for a hierarchy, + ffttss__cchhiillddrreenn() will return a pointer to the files in the logical directo- + ry specified to ffttss__ooppeenn(), i.e. the arguments specified to ffttss__ooppeenn(). + Otherwise, if the _F_T_S_E_N_T structure most recently returned by ffttss__rreeaadd() + is not a directory being visited in pre-order, or the directory does not + contain any files, ffttss__cchhiillddrreenn() returns NULL and sets _e_r_r_n_o to zero. + If an error occurs, ffttss__cchhiillddrreenn() returns NULL and sets _e_r_r_n_o appropri- + ately. + + The _F_T_S_E_N_T structures returned by ffttss__cchhiillddrreenn() may be overwritten after + a call to ffttss__cchhiillddrreenn(), ffttss__cclloossee() or ffttss__rreeaadd() on the same file hi- + erarchy stream. + + _O_p_t_i_o_n may be set to the following value: + + 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 _f_t_s___n_a_m_e and + _f_t_s___n_a_m_e_l_e_n fields. + +FFTTSS__SSEETT + The function ffttss__sseett() allows the user application to determine further + processing for the file _f of the stream _f_t_s_p. The ffttss__sseett() function re- + turns 0 on success, and -1 if an error occurs. _O_p_t_i_o_n must be set to one + of the following values: + + FTS_AGAIN Re-visit the file; any file type may be re-visited. The + next call to ffttss__rreeaadd() will return the referenced file. + The _f_t_s___s_t_a_t and _f_t_s___i_n_f_o 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 ffttss__rreeaadd(). Normal use is for + post-order directory visits, where it causes the directory + to be re-visited (in both pre and post-order) as well as + all of its descendants. + + FTS_FOLLOW The referenced file must be a symbolic link. If the refer- + enced file is the one most recently returned by ffttss__rreeaadd(), + the next call to ffttss__rreeaadd() returns the file with the + _f_t_s___i_n_f_o and _f_t_s___s_t_a_t_p 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 ffttss__cchhiillddrreenn(), the _f_t_s___i_n_f_o and _f_t_s___s_t_a_t_p fields of the + structure, when returned by ffttss__rreeaadd(), 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 _f_t_s___i_n_f_o field will be set to FTS_SLNONE. + + If the target of the link is a directory, the pre-order re- + turn, followed by the return of all of its descendants, + followed by a post-order return, is done. + + FTS_SKIP No descendants of this file are visited. The file may be + one of those most recently returned by either + ffttss__cchhiillddrreenn() or ffttss__rreeaadd(). + +FFTTSS__CCLLOOSSEE + The ffttss__cclloossee() function closes a file hierarchy stream _f_t_s_p and restores + the current directory to the directory from which ffttss__ooppeenn() was called + to open _f_t_s_p. The ffttss__cclloossee() function returns 0 on success, and -1 if an + error occurs. + +EERRRROORRSS + The function ffttss__ooppeenn() may fail and set _e_r_r_n_o for any of the errors + specified for the library functions open(2) and malloc(3). + + The function ffttss__cclloossee() may fail and set _e_r_r_n_o for any of the errors + specified for the library functions chdir(2) and close(2). + + The functions ffttss__rreeaadd() and ffttss__cchhiillddrreenn() may fail and set _e_r_r_n_o for + any of the errors specified for the library functions chdir(2), + malloc(3), opendir(3), readdir(3) and stat(2). + + In addition, ffttss__cchhiillddrreenn(), ffttss__ooppeenn() and ffttss__sseett() may fail and set + _e_r_r_n_o as follows: + + [EINVAL] The options were invalid. + +SSEEEE AALLSSOO + find(1), chdir(2), stat(2), qsort(3) + +SSTTAANNDDAARRDDSS + The ffttss utility is expected to be a superset of the IEEE Std1003.1-1988 + (``POSIX'') specification. + +4.4BSD June 4, 1993 6 diff --git a/usr/share/man/cat3/funopen.0 b/usr/share/man/cat3/funopen.0 new file mode 100644 index 0000000000..05eca5891a --- /dev/null +++ b/usr/share/man/cat3/funopen.0 @@ -0,0 +1,74 @@ +FUNOPEN(3) BSD Programmer's Manual FUNOPEN(3) + +NNAAMMEE + ffuunnooppeenn, ffrrooppeenn, ffwwooppeenn - open a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffuunnooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_), + _i_n_t _(_w_r_i_t_e_f_n_*_)_(_v_o_i_d _*_, _c_o_n_s_t _c_h_a_r _*_, _i_n_t_), + _f_p_o_s___t _(_s_e_e_k_f_n_*_)_(_v_o_i_d _*_, _f_p_o_s___t_, _i_n_t_), _i_n_t _(_c_l_o_s_e_f_n_*_)_(_v_o_i_d _*_)); + + _F_I_L_E _* + ffrrooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + + _F_I_L_E _* + ffwwooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_w_r_i_t_e_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + +DDEESSCCRRIIPPTTIIOONN + The ffuunnooppeenn() function associates a stream with up to four ``I/O + functions''. Either _r_e_a_d_f_n or _w_r_i_t_e_f_n must be specified; the others can + be given as an appropriately-typed NULL pointer. These I/O functions + will be used to read, write, seek and close the new stream. + + In general, omitting a function means that any attempt to perform the as- + sociated operation on the resulting stream will fail. If the close func- + tion is omitted, closing the stream will flush any buffered output and + then succeed. + + The calling conventions of _r_e_a_d_f_n, _w_r_i_t_e_f_n, _s_e_e_k_f_n and _c_l_o_s_e_f_n must match + those, respectively, of read(2), write(2), seek(2), and close(2) with + the single exception that they are passed the _c_o_o_k_i_e argument specified + to ffuunnooppeenn() in place of the traditional file descriptor argument. + + Read and write I/O functions are allowed to change the underlying buffer + on fully buffered or line buffered streams by calling setvbuf(3). They + are also not required to completely fill or empty the buffer. They are + not, however, allowed to change streams from unbuffered to buffered or to + change the state of the line buffering flag. They must also be prepared + to have read or write calls occur on buffers other than the one most re- + cently specified. + + All user I/O functions can report an error by returning -1. Additional- + ly, all of the functions should set the external variable _e_r_r_n_o appropri- + ately if an error occurs. + + An error on cclloosseeffnn() does not keep the stream open. + + As a convenience, the include file <_s_t_d_i_o_._h> defines the macros ffrrooppeenn() + and ffwwooppeenn() as calls to ffuunnooppeenn() with only a read or write function + specified. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffuunnooppeenn() returns a FILE pointer. Otherwise, + NULL is returned and the global variable _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + [EINVAL] The ffuunnooppeenn() function was called without either a read or + write function. The ffuunnooppeenn() function may also fail and set + _e_r_r_n_o for any of the errors specified for the routine + malloc(3). + +SSEEEE AALLSSOO + fcntl(2), open(2), fclose(3), fopen(3), fseek(3), setbuf(3) + +HHIISSTTOORRYY + The ffuunnooppeenn() functions first appeared in 4.4BSD. + +BBUUGGSS + The ffuunnooppeenn() function may not be portable to systems other than BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/fwopen.0 b/usr/share/man/cat3/fwopen.0 new file mode 100644 index 0000000000..05eca5891a --- /dev/null +++ b/usr/share/man/cat3/fwopen.0 @@ -0,0 +1,74 @@ +FUNOPEN(3) BSD Programmer's Manual FUNOPEN(3) + +NNAAMMEE + ffuunnooppeenn, ffrrooppeenn, ffwwooppeenn - open a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ffuunnooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_), + _i_n_t _(_w_r_i_t_e_f_n_*_)_(_v_o_i_d _*_, _c_o_n_s_t _c_h_a_r _*_, _i_n_t_), + _f_p_o_s___t _(_s_e_e_k_f_n_*_)_(_v_o_i_d _*_, _f_p_o_s___t_, _i_n_t_), _i_n_t _(_c_l_o_s_e_f_n_*_)_(_v_o_i_d _*_)); + + _F_I_L_E _* + ffrrooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_r_e_a_d_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + + _F_I_L_E _* + ffwwooppeenn(_v_o_i_d _*_c_o_o_k_i_e, _i_n_t _(_*_w_r_i_t_e_f_n_)_(_v_o_i_d _*_, _c_h_a_r _*_, _i_n_t_)); + +DDEESSCCRRIIPPTTIIOONN + The ffuunnooppeenn() function associates a stream with up to four ``I/O + functions''. Either _r_e_a_d_f_n or _w_r_i_t_e_f_n must be specified; the others can + be given as an appropriately-typed NULL pointer. These I/O functions + will be used to read, write, seek and close the new stream. + + In general, omitting a function means that any attempt to perform the as- + sociated operation on the resulting stream will fail. If the close func- + tion is omitted, closing the stream will flush any buffered output and + then succeed. + + The calling conventions of _r_e_a_d_f_n, _w_r_i_t_e_f_n, _s_e_e_k_f_n and _c_l_o_s_e_f_n must match + those, respectively, of read(2), write(2), seek(2), and close(2) with + the single exception that they are passed the _c_o_o_k_i_e argument specified + to ffuunnooppeenn() in place of the traditional file descriptor argument. + + Read and write I/O functions are allowed to change the underlying buffer + on fully buffered or line buffered streams by calling setvbuf(3). They + are also not required to completely fill or empty the buffer. They are + not, however, allowed to change streams from unbuffered to buffered or to + change the state of the line buffering flag. They must also be prepared + to have read or write calls occur on buffers other than the one most re- + cently specified. + + All user I/O functions can report an error by returning -1. Additional- + ly, all of the functions should set the external variable _e_r_r_n_o appropri- + ately if an error occurs. + + An error on cclloosseeffnn() does not keep the stream open. + + As a convenience, the include file <_s_t_d_i_o_._h> defines the macros ffrrooppeenn() + and ffwwooppeenn() as calls to ffuunnooppeenn() with only a read or write function + specified. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffuunnooppeenn() returns a FILE pointer. Otherwise, + NULL is returned and the global variable _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + [EINVAL] The ffuunnooppeenn() function was called without either a read or + write function. The ffuunnooppeenn() function may also fail and set + _e_r_r_n_o for any of the errors specified for the routine + malloc(3). + +SSEEEE AALLSSOO + fcntl(2), open(2), fclose(3), fopen(3), fseek(3), setbuf(3) + +HHIISSTTOORRYY + The ffuunnooppeenn() functions first appeared in 4.4BSD. + +BBUUGGSS + The ffuunnooppeenn() function may not be portable to systems other than BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/fwrite.0 b/usr/share/man/cat3/fwrite.0 new file mode 100644 index 0000000000..2241c4a308 --- /dev/null +++ b/usr/share/man/cat3/fwrite.0 @@ -0,0 +1,41 @@ +FREAD(3) BSD Programmer's Manual FREAD(3) + +NNAAMMEE + ffrreeaadd, ffwwrriittee - binary stream input/output + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffrreeaadd(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e, _s_i_z_e___t _n_m_e_m_b, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffwwrriittee(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e, _s_i_z_e___t _n_m_e_m_b, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The function ffrreeaadd() reads _n_m_e_m_b objects, each size bytes long, from the + stream pointed to by _s_t_r_e_a_m, storing them at the location given by _p_t_r. + + The function ffwwrriittee() writes _n_m_e_m_b objects, each _s_i_z_e bytes long, to the + stream pointed to by _s_t_r_e_a_m, obtaining them from the location given by + _p_t_r. + +RREETTUURRNN VVAALLUUEESS + The functions ffrreeaadd() and ffwwrriittee() advance the file position indicator + for the stream by the number of bytes read or written. They return the + number of objects read or written. If an error occurs, or the end-of- + file is reached, the return value is a short object count (or zero). + + The function ffrreeaadd() does not distinguish between end-of-file and error, + and callers must use feof(3) and ferror(3) to determine which occurred. + The function ffwwrriittee() returns a value less than _n_m_e_m_b only if a write er- + ror has occurred. + +SSEEEE AALLSSOO + read(2), write(2) + +SSTTAANNDDAARRDDSS + The functions ffrreeaadd() and ffwwrriittee() conform to ANSI C X3.159-1989 (``ANSI + C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getbsize.0 b/usr/share/man/cat3/getbsize.0 new file mode 100644 index 0000000000..2e275d7027 --- /dev/null +++ b/usr/share/man/cat3/getbsize.0 @@ -0,0 +1,33 @@ +GETBSIZE(3) BSD Programmer's Manual GETBSIZE(3) + +NNAAMMEE + ggeettbbssiizzee - get user block size + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeettbbssiizzee(_i_n_t _*_h_e_a_d_e_r_l_e_n_p, _l_o_n_g _*_b_l_o_c_k_s_i_z_e_p); + +DDEESSCCRRIIPPTTIIOONN + The ggeettbbssiizzee function determines the user's preferred block size based on + the value of the ``BLOCKSIZE'' environment variable; see environ(7) for + details on its use and format. + + The ggeettbbssiizzee function returns a pointer to a null-terminated string de- + scribing the block size, something like ``1K-blocks''. The memory refer- + enced by _h_e_a_d_e_r_l_e_n_p is filled in with the length of the string (not in- + cluding the terminating null). The memory referenced by _b_l_o_c_k_s_i_z_e_p is + filled in with block size, in bytes. + + If the user's block size is unreasonable, a warning message is written to + standard error and the returned information reflects a block size of 512 + bytes. + +SSEEEE AALLSSOO + df(1), du(1), ls(1), systat(1), environ(7) + +HHIISSTTOORRYY + The ggeettbbssiizzee function call appeared in 4.4BSD. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getc.0 b/usr/share/man/cat3/getc.0 new file mode 100644 index 0000000000..69b529360b --- /dev/null +++ b/usr/share/man/cat3/getc.0 @@ -0,0 +1,56 @@ +GETC(3) BSD Programmer's Manual GETC(3) + +NNAAMMEE + ffggeettcc, ggeettcc, ggeettcchhaarr, ggeettww - get next character or word from input stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcchhaarr(); + + _i_n_t + ggeettww(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettcc() function obtains the next input character (if present) from + the stream pointed at by _s_t_r_e_a_m, or the next character pushed back on the + stream via ungetc. + + The ggeettcc() function acts essentially identically to ffggeettcc(), but is a + macro that expands in-line. + + The ggeettcchhaarr() function is equivalent to: getc with the argument stdin. + + The ggeettww() function obtains the next _i_n_t (if present) from the stream + pointed at by _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + If successful, these routines return the next requested object from the + _s_t_r_e_a_m. If the stream is at end-of-file or a read error occurs, the rou- + tines return EOF. The routines feof(3) and ferror(3) must be used to dis- + tinguish between end-of-file and error. If an error occurs, the global + variable _e_r_r_n_o is set to indicate the error. The end-of-file condition + is remembered, even on a terminal, and all subsequent attempts to read + will return EOF until the condition is cleared with clearerr. + +SSEEEE AALLSSOO + ferror(3), fread(3), fopen(3), putc(3), ungetc(3) + +SSTTAANNDDAARRDDSS + The ffggeettcc(), ggeettcc() and ggeettcchhaarr() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + Since EOF is a valid integer value, feof and ferror must be used to check + for failure after calling ggeettww(). The size and byte order of an _i_n_t + varies from one machine to another, and ggeettww() is not recommended for + portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getcap.0 b/usr/share/man/cat3/getcap.0 new file mode 100644 index 0000000000..40eab2d30f --- /dev/null +++ b/usr/share/man/cat3/getcap.0 @@ -0,0 +1,279 @@ +GETCAP(3) BSD Programmer's Manual GETCAP(3) + +NNAAMMEE + ccggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettccaapp, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, + ccggeettffiirrsstt, ccggeettnneexxtt, ccggeettcclloossee - capability database access routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ccggeetteenntt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y, _c_h_a_r _*_n_a_m_e); + + _i_n_t + ccggeettsseett(_c_h_a_r _*_e_n_t); + + _i_n_t + ccggeettmmaattcchh(_c_h_a_r _*_b_u_f, _c_h_a_r _*_n_a_m_e); + + _c_h_a_r _* + ccggeettccaapp(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _t_y_p_e); + + _i_n_t + ccggeettnnuumm(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _l_o_n_g _*_n_u_m); + + _i_n_t + ccggeettssttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettuussttrr(_c_h_a_r _*_b_u_f, _c_h_a_r _*_c_a_p, _c_h_a_r _*_*_s_t_r); + + _i_n_t + ccggeettffiirrsstt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettnneexxtt(_c_h_a_r _*_*_b_u_f, _c_h_a_r _*_*_d_b___a_r_r_a_y); + + _i_n_t + ccggeettcclloossee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + CCggeetteenntt() extracts the capability rec _n_a_m_e from the database specified by + the NULL terminated file array _d_b___a_r_r_a_y and returns a pointer to a + malloc'd copy of it in _b_u_f. CCggeetteenntt will first look for files ending in + ..ddbb (see cap_mkdb(1)) before accessing the ASCII file. _B_u_f must be re- + tained through all subsequent calls to ccggeettmmaattcchh(), ccggeettccaapp(), ccggeettnnuumm(), + ccggeettssttrr(), and ccggeettuussttrr(), but may then be free'd. On success 0 is re- + turned, 1 if the returned record contains an unresolved ttcc expansion, -1 + if the requested record couldn't be found, -2 if a system error was en- + countered (couldn't open/read a file, etc.) also setting _e_r_r_n_o, and -3 if + a potential reference loop is detected (see ttcc== comments below). + + CCggeettsseett enables the addition of a character buffer containing a single + capability record entry to the capability database. Conceptually, the + entry is added as the first ``file'' in the database, and is therefore + searched first on the call to ccggeetteenntt. The entry is passed in _e_n_t. If _e_n_t + is NULL, the current entry is removed from the database. CCggeettsseett must + precede the database traversal. It must be called before the ccggeetteenntt + call. If a sequential access is being performed (see below), it must be + called before the first sequential access call ( ccggeettffiirrsstt or ccggeettnneexxtt ), + or be directly preceded by a ccggeettcclloossee call. On success 0 is returned + and -1 on failure. + + CCggeettmmaattcchh will return 0 if _n_a_m_e is one of the names of the capability + record _b_u_f, -1 if not. + + + CCggeettccaapp searches the capability record _b_u_f for the capability _c_a_p with + type _t_y_p_e. A _t_y_p_e is specified using any single character. If a colon + (`:') is used, an untyped capability will be searched for (see below for + explanation of types). A pointer to the value of _c_a_p in _b_u_f is returned + on success, NULL if the requested capability couldn't be found. The end + of the capability value is signaled by a `:' or ASCII NUL (see below for + capability database syntax). + + CCggeettnnuumm retrieves the value of the numeric capability _c_a_p from the capa- + bility record pointed to by _b_u_f. The numeric value is returned in the + _l_o_n_g pointed to by _n_u_m. 0 is returned on success, -1 if the requested nu- + meric capability couldn't be found. + + CCggeettssttrr retrieves the value of the string capability _c_a_p from the capa- + bility record pointed to by _b_u_f. A pointer to a decoded, NUL terminated, + malloc'd copy of the string is returned in the _c_h_a_r _* pointed to by _s_t_r. + The number of characters in the decoded string not including the trailing + NUL is returned on success, -1 if the requested string capability + couldn't be found, -2 if a system error was encountered (storage alloca- + tion failure). + + CCggeettuussttrr is identical to ccggeettssttrr except that it does not expand special + characters, but rather returns each character of the capability string + literally. + + CCggeettffiirrsstt, ccggeettnneexxtt, comprise a function group that provides for sequen- + tial access of the NULL pointer terminated array of file names, _d_b___a_r_r_a_y. + CCggeettffiirrsstt returns the first record in the database and resets the access + to the first record. CCggeettnneexxtt returns the next record in the database + with respect to the record returned by the previous ccggeettffiirrsstt or ccggeettnneexxtt + call. If there is no such previous call, the first record in the + database is returned. Each record is returned in a malloc'd copy point- + ed to by _b_u_f. TTcc expansion is done (see ttcc== comments below). Upon com- + pletion of the database 0 is returned, 1 is returned upon successful re- + turn of record with possibly more remaining (we haven't reached the end + of the database yet), 2 is returned if the record contains an unresolved + ttcc expansion, -1 is returned if an system error occured, and -2 is re- + turned if a potential reference loop is detected (see ttcc== comments be- + low). Upon completion of database (0 return) the database is closed. + + CCggeettcclloossee closes the sequential access and frees any memory and file de- + scriptors being used. Note that it does not erase the buffer pushed by a + call to ccggeettsseett. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSYYNNTTAAXX + Capability databases are normally ASCII and may be edited with standard + text editors. Blank lines and lines beginning with a `#' are comments + and are ignored. Lines ending with a `\' indicate that the next line is + a continuation of the current line; the `\' and following newline are ig- + nored. Long lines are usually continued onto several physical lines by + ending each line except the last with a `\'. + + Capability databases consist of a series of records, one per logical + line. Each record contains a variable number of `:'-separated fields + (capabilities). Empty fields consisting entirely of white space charac- + ters (spaces and tabs) are ignored. + + The first capability of each record specifies its names, separated by `|' + characters. These names are used to reference records in the database. + By convention, the last name is usually a comment and is not intended as + a lookup tag. For example, the _v_t_1_0_0 record from the tteerrmmccaapp database + begins: + + d0|vt100|vt100-am|vt100am|dec vt100: + + + giving four names that can be used to access the record. + + The remaining non-empty capabilities describe a set of (name, value) + bindings, consisting of a names optionally followed by a typed values: + + name typeless [boolean] capability _n_a_m_e is present [true] + name_Tvalue capability (_n_a_m_e, _T) has value _v_a_l_u_e + name@ no capability _n_a_m_e exists + name_T@ capability (_n_a_m_e, _T) does not exist + + Names consist of one or more characters. Names may contain any character + except `:', but it's usually best to restrict them to the printable char- + acters and avoid use of graphics like `#', `=', `%', `@', etc. Types are + single characters used to separate capability names from their associated + typed values. Types may be any character except a `:'. Typically, + graphics like `#', `=', `%', etc. are used. Values may be any number of + characters and may contain any character except `:'. + +CCAAPPAABBIILLIITTYY DDAATTAABBAASSEE SSEEMMAANNTTIICCSS + Capability records describe a set of (name, value) bindings. Names may + have multiple values bound to them. Different values for a name are dis- + tinguished by their _t_y_p_e_s. CCggeettccaapp will return a pointer to a value of a + name given the capability name and the type of the value. + + The types `#' and `=' are conventionally used to denote numeric and + string typed values, but no restriction on those types is enforced. The + functions ccggeettnnuumm and ccggeettssttrr can be used to implement the traditional + syntax and semantics of `#' and `='. Typeless capabilities are typically + used to denote boolean objects with presence or absence indicating truth + and false values respectively. This interpretation is conveniently rep- + resented by: + + (getcap(buf, name, ':') != NULL) + + A special capability, ttcc== nnaammee, is used to indicate that the record spec- + ified by _n_a_m_e should be substituted for the ttcc capability. TTcc capabili- + ties may interpolate records which also contain ttcc capabilities and more + than one ttcc capability may be used in a record. A ttcc expansion scope + (i.e., where the argument is searched for) contains the file in which the + ttcc is declared and all subsequent files in the file array. + + When a database is searched for a capability record, the first matching + record in the search is returned. When an record is scanned for a capa- + bility, the first matching capability is returned; the capability + ::nnaammeeTT@@:: will hide any following definition of a value of type _T for + _n_a_m_e; and the capability ::nnaammee@@:: will prevent any following values of + _n_a_m_e from being seen. + + These features combined with ttcc capabilities can be used to generate + variations of other databases and records by either adding new capabili- + ties, overriding definitions with new definitions, or hiding following + definitions via `@' capabilities. + +EEXXAAMMPPLLEESS + example|an example of binding multiple values to names:\ + :foo%bar:foo^blah:foo@:\ + :abc%xyz:abc^frap:abc$@:\ + :tc=more: + + The capability foo has two values bound to it (bar of type `%' and blah + of type `^') and any other value bindings are hidden. The capability abc + also has two values bound but only a value of type `$' is prevented from + being defined in the capability record more. + + + file1: + new|new_record|a modification of "old":\ + :fript=bar:who-cares@:tc=old:blah:tc=extensions: + file2: + old|old_record|an old database record:\ + :fript=foo:who-cares:glork#200: + + The records are extracted by calling ccggeetteenntt with file1 preceding file2. + In the capability record new in file1, fript=bar overrides the definition + of fript=foo interpolated from the capability record old in file2, who- + cares@ prevents the definition of any who-cares definitions in old from + being seen, glork#200 is inherited from old, and blah and anything de- + fined by the record extensions is added to those definitions in old. + Note that the position of the fript=bar and who-cares@ definitions before + tc=old is important here. If they were after, the definitions in old + would take precedence. + +CCGGEETTNNUUMM AANNDD CCGGEETTSSTTRR SSYYNNTTAAXX AANNDD SSEEMMAANNTTIICCSS + Two types are predefined by ccggeettnnuumm and ccggeettssttrr: + + _n_a_m_e#_n_u_m_b_e_r numeric capability _n_a_m_e has value _n_u_m_b_e_r + _n_a_m_e=_s_t_r_i_n_g string capability _n_a_m_e has value _s_t_r_i_n_g + _n_a_m_e#@ the numeric capability _n_a_m_e does not exist + _n_a_m_e=@ the string capability _n_a_m_e does not exist + + Numeric capability values may be given in one of three numeric bases. If + the number starts with either `0x' or `0X' it is interpreted as a hex- + adecimal number (both upper and lower case a-f may be used to denote the + extended hexadecimal digits). Otherwise, if the number starts with a `0' + it is interpreted as an octal number. Otherwise the number is interpret- + ed as a decimal number. + + String capability values may contain any character. Non-printable ASCII + codes, new lines, and colons may be conveniently represented by the use + of escape sequences: + + ^X ('_X' & 037) control-_X + \b, \B (ASCII 010) backspace + \t, \T (ASCII 011) tab + \n, \N (ASCII 012) line feed (newline) + \f, \F (ASCII 014) form feed + \r, \R (ASCII 015) carriage return + \e, \E (ASCII 027) escape + \c, \C (:) colon + \\ (\) back slash + \^ (^) caret + \_n_n_n (ASCII octal _n_n_n) + + A `\' may be followed by up to three octal digits directly specifies the + numeric code for a character. The use of ASCII NULs, while easily encod- + ed, causes all sorts of problems and must be used with care since NULs + are typically used to denote the end of strings; many applications use + `\200' to represent a NUL. + +DDIIAAGGNNOOSSTTIICCSS + CCggeetteenntt, ccggeettsseett, ccggeettmmaattcchh, ccggeettnnuumm, ccggeettssttrr, ccggeettuussttrr, ccggeettffiirrsstt, and + ccggeettnneexxtt return a a value greater than or equal to 0 on success and a + value less than 0 on failure. CCggeettccaapp returns a character pointer on + success and a NULL on failure. + + CCggeetteenntt, and ccggeettsseeqq may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions: fopen(2), fclose(2), open(2), and + close(2). + + CCggeetteenntt, ccggeettsseett, ccggeettssttrr, and ccggeettuussttrr may fail and set _e_r_r_n_o as fol- + + lows: + + [ENOMEM] No memory to allocate. + +SSEEEE AALLSSOO + cap_mkdb(1), malloc(3) + +BBUUGGSS + Colons (`:') can't be used in names, types, or values. + + There are no checks for ttcc==nnaammee loops in ccggeetteenntt. + + The buffer added to the database by a call to ccggeettsseett is not unique to + the database but is rather prepended to any database used. + +4.4BSD June 4, 1993 5 diff --git a/usr/share/man/cat3/getchar.0 b/usr/share/man/cat3/getchar.0 new file mode 100644 index 0000000000..69b529360b --- /dev/null +++ b/usr/share/man/cat3/getchar.0 @@ -0,0 +1,56 @@ +GETC(3) BSD Programmer's Manual GETC(3) + +NNAAMMEE + ffggeettcc, ggeettcc, ggeettcchhaarr, ggeettww - get next character or word from input stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcchhaarr(); + + _i_n_t + ggeettww(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettcc() function obtains the next input character (if present) from + the stream pointed at by _s_t_r_e_a_m, or the next character pushed back on the + stream via ungetc. + + The ggeettcc() function acts essentially identically to ffggeettcc(), but is a + macro that expands in-line. + + The ggeettcchhaarr() function is equivalent to: getc with the argument stdin. + + The ggeettww() function obtains the next _i_n_t (if present) from the stream + pointed at by _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + If successful, these routines return the next requested object from the + _s_t_r_e_a_m. If the stream is at end-of-file or a read error occurs, the rou- + tines return EOF. The routines feof(3) and ferror(3) must be used to dis- + tinguish between end-of-file and error. If an error occurs, the global + variable _e_r_r_n_o is set to indicate the error. The end-of-file condition + is remembered, even on a terminal, and all subsequent attempts to read + will return EOF until the condition is cleared with clearerr. + +SSEEEE AALLSSOO + ferror(3), fread(3), fopen(3), putc(3), ungetc(3) + +SSTTAANNDDAARRDDSS + The ffggeettcc(), ggeettcc() and ggeettcchhaarr() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + Since EOF is a valid integer value, feof and ferror must be used to check + for failure after calling ggeettww(). The size and byte order of an _i_n_t + varies from one machine to another, and ggeettww() is not recommended for + portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getdiskbyname.0 b/usr/share/man/cat3/getdiskbyname.0 new file mode 100644 index 0000000000..592dbd9138 --- /dev/null +++ b/usr/share/man/cat3/getdiskbyname.0 @@ -0,0 +1,24 @@ +GETDISKBYNAME(3) BSD Programmer's Manual GETDISKBYNAME(3) + +NNAAMMEE + ggeettddiisskkbbyynnaammee - get generic disk description by its name + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _d_i_s_k_l_a_b_e_l _* + ggeettddiisskkbbyynnaammee(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + The ggeettddiisskkbbyynnaammee() function takes a disk name (e.g. `rm03') and returns + a prototype disk label describing its geometry information and the stan- + dard disk partition tables. All information is obtained from the disk- + tab(5) file. + +SSEEEE AALLSSOO + disklabel(5), disktab(5), disklabel(8) + +HHIISSTTOORRYY + The ggeettddiisskkbbyynnaammee() function appeared in 4.3BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/getenv.0 b/usr/share/man/cat3/getenv.0 new file mode 100644 index 0000000000..950f18b3c3 --- /dev/null +++ b/usr/share/man/cat3/getenv.0 @@ -0,0 +1,64 @@ +GETENV(3) BSD Programmer's Manual GETENV(3) + +NNAAMMEE + ggeetteennvv, ppuutteennvv, sseetteennvv, uunnsseetteennvv - environment variable functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _i_n_t + sseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _c_o_n_s_t _c_h_a_r _*_v_a_l_u_e, _i_n_t _o_v_e_r_w_r_i_t_e); + + _i_n_t + ppuutteennvv(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + uunnsseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + These functions set, unset and fetch environment variables from the host + _e_n_v_i_r_o_n_m_e_n_t _l_i_s_t. For compatibility with differing environment conven- + tions, the given arguments _n_a_m_e and _v_a_l_u_e may be appended and prepended, + respectively, with an equal sign ``=''. + + The ggeetteennvv() function obtains the current value of the environment vari- + able, _n_a_m_e. If the variable _n_a_m_e is not in the current environment , a + null pointer is returned. + + The sseetteennvv() function inserts or resets the environment variable _n_a_m_e in + the current environment list. If the variable _n_a_m_e does not exist in the + list, it is inserted with the given _v_a_l_u_e_. If the variable does exist, + the argument _o_v_e_r_w_r_i_t_e is tested; if _o_v_e_r_w_r_i_t_e _i_s zero, the variable is + not reset, otherwise it is reset to the given _v_a_l_u_e. + + The ppuutteennvv() function takes an argument of the form ``name=value'' and is + equivalent to: + + setenv(name, value, 1); + + The uunnsseetteennvv() function deletes all instances of the variable name point- + ed to by _n_a_m_e from the list. + +RREETTUURRNN VVAALLUUEESS + The functions sseetteennvv() and ppuutteennvv() return zero if successful; otherwise + the global variable _e_r_r_n_o is set to indicate the error and a -1 is re- + turned. + +EERRRROORRSS + [ENOMEM] The function sseetteennvv() or ppuutteennvv() failed because they were un- + able to allocate memory for the environment. + +SSEEEE AALLSSOO + csh(1), sh(1), execve(2), environ(7) + +SSTTAANNDDAARRDDSS + The ggeetteennvv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions sseetteennvv() and uunnsseetteennvv() appeared in Version 7 AT&T UNIX. + The ppuutteennvv() function appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getfsent.0 b/usr/share/man/cat3/getfsent.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/getfsent.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getfsfile.0 b/usr/share/man/cat3/getfsfile.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/getfsfile.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getfsspec.0 b/usr/share/man/cat3/getfsspec.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/getfsspec.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getfstype.0 b/usr/share/man/cat3/getfstype.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/getfstype.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getgrent.0 b/usr/share/man/cat3/getgrent.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/getgrent.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/getgrgid.0 b/usr/share/man/cat3/getgrgid.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/getgrgid.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/getgrnam.0 b/usr/share/man/cat3/getgrnam.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/getgrnam.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/getgrouplist.0 b/usr/share/man/cat3/getgrouplist.0 new file mode 100644 index 0000000000..19c2f31cc9 --- /dev/null +++ b/usr/share/man/cat3/getgrouplist.0 @@ -0,0 +1,42 @@ +GETGROUPLIST(3) BSD Programmer's Manual GETGROUPLIST(3) + +NNAAMMEE + ggeettggrroouupplliisstt - calculate group access list + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettggrroouupplliisstt(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _i_n_t _b_a_s_e_g_i_d, _i_n_t _*_g_r_o_u_p_s, _i_n_t _*_n_g_r_o_u_p_s); + +DDEESSCCRRIIPPTTIIOONN + The ggeettggrroouupplliisstt() function reads through the group file and calculates + the group access list for the user specified in _n_a_m_e. The _b_a_s_e_g_i_d is au- + tomatically included in the groups list. Typically this value is given + as the group number from the password file. + + The resulting group list is returned in the integer array pointed to by + _g_r_o_u_p_s. The caller specifies the size of the _g_r_o_u_p_s array in the integer + pointed to by _n_g_r_o_u_p_s; the actual number of groups found is returned in + _n_g_r_o_u_p_s. + +RREETTUURRNN VVAALLUUEESS + The ggeettggrroouupplliisstt() function returns -1 if the size of the group list is + too small to hold all the user's groups. Here, the group array will be + filled with as many groups as will fit. + +FFIILLEESS + /etc/group group membership list + +SSEEEE AALLSSOO + setgroups(2), initgroups(3) + +HHIISSTTOORRYY + The ggeettggrroouupplliisstt() function first appeared in 4.4BSD. + +BBUUGGSS + The ggeettggrroouupplliisstt() function uses the routines based on getgrent(3). If + the invoking program uses any of these routines, the group structure will + be overwritten in the call to ggeettggrroouupplliisstt(). + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/gethostbyaddr.0 b/usr/share/man/cat3/gethostbyaddr.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/gethostbyaddr.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/gethostbyname.0 b/usr/share/man/cat3/gethostbyname.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/gethostbyname.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/gethostent.0 b/usr/share/man/cat3/gethostent.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/gethostent.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/gethostname.0 b/usr/share/man/cat3/gethostname.0 new file mode 100644 index 0000000000..96276ea867 --- /dev/null +++ b/usr/share/man/cat3/gethostname.0 @@ -0,0 +1,48 @@ +GETHOSTNAME(3) BSD Programmer's Manual GETHOSTNAME(3) + +NNAAMMEE + ggeetthhoossttnnaammee, sseetthhoossttnnaammee - get/set name of current host + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeetthhoossttnnaammee(_c_h_a_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + + _i_n_t + sseetthhoossttnnaammee(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeetthhoossttnnaammee() returns the standard host name for the current processor, + as previously set by sseetthhoossttnnaammee(). The parameter _n_a_m_e_l_e_n specifies the + size of the _n_a_m_e array. The returned name is null-terminated unless in- + sufficient space is provided. + + SSeetthhoossttnnaammee() sets the name of the host machine to be _n_a_m_e, which has + length _n_a_m_e_l_e_n. This call is restricted to the super-user and is normally + used only when the system is bootstrapped. + +RREETTUURRNN VVAALLUUEESS + If the call succeeds a value of 0 is returned. If the call fails, a val- + ue of -1 is returned and an error code is placed in the global location + _e_r_r_n_o. + +EERRRROORRSS + The following errors may be returned by these calls: + + [EFAULT] The _n_a_m_e or _n_a_m_e_l_e_n parameter gave an invalid address. + + [EPERM] The caller tried to set the hostname and was not the super- + user. + +SSEEEE AALLSSOO + sysctl(2) gethostid(3) + +BBUUGGSS + Host names are limited to MAXHOSTNAMELEN (from <_s_y_s_/_p_a_r_a_m_._h>) characters, + currently 256. + +HHIISSTTOORRYY + The ggeetthhoossttnnaammee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/getloadavg.0 b/usr/share/man/cat3/getloadavg.0 new file mode 100644 index 0000000000..0910e25821 --- /dev/null +++ b/usr/share/man/cat3/getloadavg.0 @@ -0,0 +1,26 @@ +GETLOADAVG(3) BSD Programmer's Manual GETLOADAVG(3) + +NNAAMMEE + ggeettllooaaddaavvgg - get system load averages + +SSYYNNOOPPSSIISS + ggeettllooaaddaavvgg(_d_o_u_b_l_e _l_o_a_d_a_v_g_[_], _i_n_t _n_e_l_e_m); + +DDEESSCCRRIIPPTTIIOONN + The ggeettllooaaddaavvgg() function returns the number of processes in the system + run queue averaged over various periods of time. Up to _n_e_l_e_m samples are + retrieved and assigned to successive elements of _l_o_a_d_a_v_g[]. The system + imposes a maximum of 3 samples, representing averages over the last 1, 5, + and 15 minutes, respectively. + +DDIIAAGGNNOOSSTTIICCSS + If the load average was unobtainable, -1 is returned; otherwise, the num- + ber of samples actually retrieved is returned. + +SSEEEE AALLSSOO + uptime(1), sysctl(2), kvm_getloadavg(3) + +HHIISSTTOORRYY + The ggeettllooaaddaavvgg() function appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getmntinfo.0 b/usr/share/man/cat3/getmntinfo.0 new file mode 100644 index 0000000000..0f43791782 --- /dev/null +++ b/usr/share/man/cat3/getmntinfo.0 @@ -0,0 +1,47 @@ +GETMNTINFO(3) BSD Programmer's Manual GETMNTINFO(3) + +NNAAMMEE + ggeettmmnnttiinnffoo - get information about mounted file systems + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ggeettmmnnttiinnffoo(_s_t_r_u_c_t _s_t_a_t_f_s _*_*_m_n_t_b_u_f_p, _i_n_t _f_l_a_g_s); + +DDEESSCCRRIIPPTTIIOONN + The ggeettmmnnttiinnffoo() function returns an array of statfs structures describ- + ing each currently mounted file system (see statfs(2)). + + The ggeettmmnnttiinnffoo() function passes its _f_l_a_g_s parameter transparently to + getfsstat(2). + +RREETTUURRNN VVAALLUUEESS + On successful completion, ggeettmmnnttiinnffoo() returns a count of the number of + elements in the array. The pointer to the array is stored into _m_n_t_b_u_f_p. + + If an error occurs, zero is returned and the external variable _e_r_r_n_o is + set to indicate the error. Although the pointer _m_n_t_b_u_f_p will be unmodi- + fied, any information previously returned by ggeettmmnnttiinnffoo() will be lost. + +EERRRROORRSS + The ggeettmmnnttiinnffoo() function may fail and set errno for any of the errors + specified for the library routines getfsstat(2) or malloc(3). + +SSEEEE AALLSSOO + getfsstat(2), statfs(2), mount(2), mount(8) + +HHIISSTTOORRYY + The ggeettmmnnttiinnffoo() function first appeared in 4.4BSD. + +BBUUGGSS + The ggeettmmnnttiinnffoo() function writes the array of structures to an internal + static object and returns a pointer to that object. Subsequent calls to + ggeettmmnnttiinnffoo() will modify the same object. + + The memory allocated by ggeettmmnnttiinnffoo() cannot be free(2)'d by the applica- + tion. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/getmode.0 b/usr/share/man/cat3/getmode.0 new file mode 100644 index 0000000000..bb699dc2f7 --- /dev/null +++ b/usr/share/man/cat3/getmode.0 @@ -0,0 +1,39 @@ +SETMODE(3) BSD Programmer's Manual SETMODE(3) + +NNAAMMEE + ggeettmmooddee, sseettmmooddee - modify mode bits + +SSYYNNOOPPSSIISS + _m_o_d_e___t + ggeettmmooddee(_c_o_n_s_t _v_o_i_d _*_s_e_t, _m_o_d_e___t _m_o_d_e); + + _v_o_i_d + sseettmmooddee(_c_o_n_s_t _c_h_a_r _*_m_o_d_e___s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ggeettmmooddee() function returns a copy of the file permission bits _m_o_d_e as + altered by the values pointed to by _s_e_t. While only the mode bits are al- + tered, other parts of the file mode may be examined. + + The sseettmmooddee() function takes an absolute (octal) or symbolic value, as + described in chmod(1), as an argument and returns a pointer to mode val- + ues to be supplied to ggeettmmooddee(). Because some of the symbolic values are + relative to the file creation mask, sseettmmooddee() may call umask(2). If this + occurs, the file creation mask will be restored before sseettmmooddee() returns. + If the calling program changes the value of its file creation mask after + calling sseettmmooddee(), sseettmmooddee() must be called again if ggeettmmooddee() is to mod- + ify future file modes correctly. + + If the mode passed to sseettmmooddee() is invalid, sseettmmooddee() returns NULL. + +EERRRROORRSS + The sseettmmooddee() function may fail and set errno for any of the errors spec- + ified for the library routine malloc(3). + +SSEEEE AALLSSOO + chmod(1), stat(2), umask(2), malloc(3) + +HHIISSTTOORRYY + The ggeettmmooddee() and sseettmmooddee() functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/getnetbyaddr.0 b/usr/share/man/cat3/getnetbyaddr.0 new file mode 100644 index 0000000000..24b8430da1 --- /dev/null +++ b/usr/share/man/cat3/getnetbyaddr.0 @@ -0,0 +1,81 @@ +GETNETENT(3) BSD Programmer's Manual GETNETENT(3) + +NNAAMMEE + ggeettnneetteenntt, ggeettnneettbbyyaaddddrr, ggeettnneettbbyynnaammee, sseettnneetteenntt, eennddnneetteenntt - get network + entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneetteenntt(); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyyaaddddrr(_l_o_n_g _n_e_t, _i_n_t _t_y_p_e); + + sseettnneetteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddnneetteenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettnneetteenntt(), ggeettnneettbbyynnaammee(), and ggeettnneettbbyyaaddddrr() functions each return + a pointer to an object with the following structure containing the bro- + ken-out fields of a line in the network data base, _/_e_t_c_/_n_e_t_w_o_r_k_s. + + struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net number type */ + unsigned long n_net; /* net number */ + }; + + The members of this structure are: + + _n___n_a_m_e The official name of the network. + + _n___a_l_i_a_s_e_s A zero terminated list of alternate names for the network. + + _n___a_d_d_r_t_y_p_e The type of the network number returned; currently only + AF_INET. + + _n___n_e_t The network number. Network numbers are returned in machine + byte order. + + The ggeettnneetteenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettnneetteenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettnneettbbyynnaammee() or ggeettnneettbbyyaaddddrr(). + + The eennddnneetteenntt() function closes the file. + + The ggeettnneettbbyynnaammee() function and ggeettnneettbbyyaaddddrr() sequentially search from + the beginning of the file until a matching net name or net address and + type is found, or until EOF is encountered. Network numbers are supplied + in host order. + +FFIILLEESS + /etc/networks + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + networks(5) + +HHIISSTTOORRYY + The ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), ggeettnneettbbyynnaammee(), sseettnneetteenntt(), and + eennddnneetteenntt() functions appeared in 4.2BSD. + +BBUUGGSS + The data space used by these functions is static; if future use requires + the data, it should be copied before any subsequent calls to these func- + tions overwrite it. Only Internet network numbers are currently under- + stood. Expecting network numbers to fit in no more than 32 bits is prob- + ably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getnetbyname.0 b/usr/share/man/cat3/getnetbyname.0 new file mode 100644 index 0000000000..24b8430da1 --- /dev/null +++ b/usr/share/man/cat3/getnetbyname.0 @@ -0,0 +1,81 @@ +GETNETENT(3) BSD Programmer's Manual GETNETENT(3) + +NNAAMMEE + ggeettnneetteenntt, ggeettnneettbbyyaaddddrr, ggeettnneettbbyynnaammee, sseettnneetteenntt, eennddnneetteenntt - get network + entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneetteenntt(); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyyaaddddrr(_l_o_n_g _n_e_t, _i_n_t _t_y_p_e); + + sseettnneetteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddnneetteenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettnneetteenntt(), ggeettnneettbbyynnaammee(), and ggeettnneettbbyyaaddddrr() functions each return + a pointer to an object with the following structure containing the bro- + ken-out fields of a line in the network data base, _/_e_t_c_/_n_e_t_w_o_r_k_s. + + struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net number type */ + unsigned long n_net; /* net number */ + }; + + The members of this structure are: + + _n___n_a_m_e The official name of the network. + + _n___a_l_i_a_s_e_s A zero terminated list of alternate names for the network. + + _n___a_d_d_r_t_y_p_e The type of the network number returned; currently only + AF_INET. + + _n___n_e_t The network number. Network numbers are returned in machine + byte order. + + The ggeettnneetteenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettnneetteenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettnneettbbyynnaammee() or ggeettnneettbbyyaaddddrr(). + + The eennddnneetteenntt() function closes the file. + + The ggeettnneettbbyynnaammee() function and ggeettnneettbbyyaaddddrr() sequentially search from + the beginning of the file until a matching net name or net address and + type is found, or until EOF is encountered. Network numbers are supplied + in host order. + +FFIILLEESS + /etc/networks + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + networks(5) + +HHIISSTTOORRYY + The ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), ggeettnneettbbyynnaammee(), sseettnneetteenntt(), and + eennddnneetteenntt() functions appeared in 4.2BSD. + +BBUUGGSS + The data space used by these functions is static; if future use requires + the data, it should be copied before any subsequent calls to these func- + tions overwrite it. Only Internet network numbers are currently under- + stood. Expecting network numbers to fit in no more than 32 bits is prob- + ably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getnetent.0 b/usr/share/man/cat3/getnetent.0 new file mode 100644 index 0000000000..24b8430da1 --- /dev/null +++ b/usr/share/man/cat3/getnetent.0 @@ -0,0 +1,81 @@ +GETNETENT(3) BSD Programmer's Manual GETNETENT(3) + +NNAAMMEE + ggeettnneetteenntt, ggeettnneettbbyyaaddddrr, ggeettnneettbbyynnaammee, sseettnneetteenntt, eennddnneetteenntt - get network + entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneetteenntt(); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyyaaddddrr(_l_o_n_g _n_e_t, _i_n_t _t_y_p_e); + + sseettnneetteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddnneetteenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettnneetteenntt(), ggeettnneettbbyynnaammee(), and ggeettnneettbbyyaaddddrr() functions each return + a pointer to an object with the following structure containing the bro- + ken-out fields of a line in the network data base, _/_e_t_c_/_n_e_t_w_o_r_k_s. + + struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net number type */ + unsigned long n_net; /* net number */ + }; + + The members of this structure are: + + _n___n_a_m_e The official name of the network. + + _n___a_l_i_a_s_e_s A zero terminated list of alternate names for the network. + + _n___a_d_d_r_t_y_p_e The type of the network number returned; currently only + AF_INET. + + _n___n_e_t The network number. Network numbers are returned in machine + byte order. + + The ggeettnneetteenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettnneetteenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettnneettbbyynnaammee() or ggeettnneettbbyyaaddddrr(). + + The eennddnneetteenntt() function closes the file. + + The ggeettnneettbbyynnaammee() function and ggeettnneettbbyyaaddddrr() sequentially search from + the beginning of the file until a matching net name or net address and + type is found, or until EOF is encountered. Network numbers are supplied + in host order. + +FFIILLEESS + /etc/networks + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + networks(5) + +HHIISSTTOORRYY + The ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), ggeettnneettbbyynnaammee(), sseettnneetteenntt(), and + eennddnneetteenntt() functions appeared in 4.2BSD. + +BBUUGGSS + The data space used by these functions is static; if future use requires + the data, it should be copied before any subsequent calls to these func- + tions overwrite it. Only Internet network numbers are currently under- + stood. Expecting network numbers to fit in no more than 32 bits is prob- + ably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getnetgrent.0 b/usr/share/man/cat3/getnetgrent.0 new file mode 100644 index 0000000000..1588f2b94f --- /dev/null +++ b/usr/share/man/cat3/getnetgrent.0 @@ -0,0 +1,64 @@ +GETNETGRENT(3) BSD Programmer's Manual GETNETGRENT(3) + +NNAAMMEE + ggeettnneettggrreenntt, iinnnneettggrr, sseettnneettggrreenntt, eennddnneettggrreenntt - netgroup database opera- + tions + +SSYYNNOOPPSSIISS + _i_n_t + ggeettnneettggrreenntt(_c_h_a_r _*_*_h_o_s_t_, _c_h_a_r _*_*_u_s_e_r_, _c_h_a_r _*_*_d_o_m_a_i_n); + + _i_n_t + iinnnneettggrr(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p_, _c_o_n_s_t _c_h_a_r _*_h_o_s_t_, _c_o_n_s_t _c_h_a_r _*_u_s_e_r_, ); + + _v_o_i_d + sseettnneettggrreenntt(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p); + + _v_o_i_d + eennddnneettggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the netgroup database file _/_e_t_c_/_n_e_t_g_r_o_u_p which + is described in netgroup(5). The database defines a set of netgroups, + each made up of one or more triples: + + (host, user, domain) + that defines a combination of host, user and domain. Any of the three + fields may be specified as ``wildcards'' that match any string. + + The function ggeettnneettggrreenntt() sets the three pointer arguments to the + strings of the next member of the current netgroup. If any of the string + pointers are ((cchhaarr **))00 that field is considered a wildcard. + + The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() set the current netgroup + and terminate the current netgroup respectively. If sseettnneettggrreenntt() is + called with a different netgroup than the previous call, an implicit + eennddnneettggrreenntt() is implied. SSeettnneettggrreenntt() also sets the offset to the + first member of the netgroup. + + The function iinnnneettggrr() searches for a match of all fields within the + specified group. If any of the hhoosstt, uusseerr, or ddoommaaiinn arguments are ((cchhaarr + **))00 those fields will match any string value in the netgroup member. + +RREETTUURRNN VVAALLUUEESS + The function ggeettnneettggrreenntt() returns 0 for ``no more netgroup members'' and + 1 otherwise. The function iinnnneettggrr() returns 1 for a successful match and + 0 otherwise. The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() have no re- + turn value. + +FFIILLEESS + /etc/netgroup netgroup database file + +SSEEEE AALLSSOO + nneettggrroouupp(_5) + +CCOOMMPPAATTIIBBIILLIITTYY + The netgroup members have three string fields to maintain compatibility + with other vendor implementations, however it is not obvious what use the + ddoommaaiinn string has within BSD. + +BBUUGGSS + The function ggeettnneettggrreenntt() returns pointers to dynamically allocated data + areas that are free'd when the function eennddnneettggrreenntt() is called. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getopt.0 b/usr/share/man/cat3/getopt.0 new file mode 100644 index 0000000000..6b23d00fdd --- /dev/null +++ b/usr/share/man/cat3/getopt.0 @@ -0,0 +1,127 @@ +GETOPT(3) BSD Programmer's Manual GETOPT(3) + +NNAAMMEE + ggeettoopptt - get option character from command line argument list + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_o_p_t_a_r_g + _e_x_t_e_r_n _i_n_t _o_p_t_i_n_d + _e_x_t_e_r_n _i_n_t _o_p_t_o_p_t + _e_x_t_e_r_n _i_n_t _o_p_t_e_r_r + _e_x_t_e_r_n _i_n_t _o_p_t_r_e_s_e_t + + _i_n_t + ggeettoopptt(_i_n_t _a_r_g_c, _c_h_a_r _* _c_o_n_s_t _*_a_r_g_v, _c_o_n_s_t _c_h_a_r _*_o_p_t_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeettoopptt() function incrementally parses a command line argument list + _a_r_g_v and returns the next _k_n_o_w_n option character. An option character is + _k_n_o_w_n if it has been specified in the string of accepted option charac- + ters, _o_p_t_s_t_r_i_n_g. + + The option string _o_p_t_s_t_r_i_n_g may contain the following elements: individu- + al characters, and characters followed by a colon to indicate an option + argument is to follow. For example, an option string "x" recognizes an + option ``--xx'', and an option string "x:" recognizes an option and argu- + ment ``--xx _a_r_g_u_m_e_n_t''. It does not matter to ggeettoopptt() if a following argu- + ment has leading white space. + + On return from ggeettoopptt(), _o_p_t_a_r_g points to an option argument, if it is + anticipated, and the variable _o_p_t_i_n_d contains the index to the next _a_r_g_v + argument for a subsequent call to ggeettoopptt(). The variable _o_p_t_o_p_t saves + the last _k_n_o_w_n option character returned by ggeettoopptt(). + + The variable _o_p_t_e_r_r and _o_p_t_i_n_d are both initialized to 1. The _o_p_t_i_n_d + variable may be set to another value before a set of calls to ggeettoopptt() in + order to skip over more or less argv entries. + + In order to use ggeettoopptt() to evaluate multiple sets of arguments, or to + evaluate a single set of arguments multiple times, the variable _o_p_t_r_e_s_e_t + must be set to 1 before the second and each additional set of calls to + ggeettoopptt(), and the variable _o_p_t_i_n_d must be reinitialized. + + The ggeettoopptt() function returns an EOF when the argument list is exhausted, + or a non-recognized option is encountered. The interpretation of options + in the argument list may be cancelled by the option `--' (double dash) + which causes ggeettoopptt() to signal the end of argument processing and return + an EOF. When all options have been processed (i.e., up to the first non- + option argument), ggeettoopptt() returns EOF. + +DDIIAAGGNNOOSSTTIICCSS + If the ggeettoopptt() function encounters a character not found in the string + _o_p_t_a_r_g or detects a missing option argument it writes an error message + and returns `?' to the _s_t_d_e_r_r. Setting _o_p_t_e_r_r to a zero will disable + these error messages. If _o_p_t_s_t_r_i_n_g has a leading `:' then then a missing + option argumet causes a `:' to be returned in addition to supressing any + error messages. option argument + + Option arguments are allowed to begin with ``-''; this is reasonable but + reduces the amount of error checking possible. + +EEXXTTEENNSSIIOONNSS + The _o_p_t_r_e_s_e_t variable was added to make it possible to call the ggeettoopptt() + function multiple times. This is an extension to the IEEE Std1003.2 + (``POSIX'') specification. + +EEXXAAMMPPLLEE + extern char *optarg; + extern int optind; + int bflag, ch, fd; + + bflag = 0; + while ((ch = getopt(argc, argv, "bf:")) != EOF) + switch(ch) { + case 'b': + bflag = 1; + break; + case 'f': + if ((fd = open(optarg, O_RDONLY, 0)) < 0) { + (void)fprintf(stderr, + "myname: %s: %s\n", optarg, strerror(errno)); + exit(1); + } + break; + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + +HHIISSTTOORRYY + The ggeettoopptt() function appeared 4.3BSD. + +BBUUGGSS + A single dash ``-'' may be specified as an character in _o_p_t_s_t_r_i_n_g, howev- + er it should _n_e_v_e_r have an argument associated with it. This allows + ggeettoopptt() to be used with programs that expect ``-'' as an option flag. + This practice is wrong, and should not be used in any current develop- + ment. It is provided for backward compatibility _o_n_l_y. By default, a sin- + gle dash causes ggeettoopptt() to return EOF. This is, we believe, compatible + with System V. + + It is also possible to handle digits as option letters. This allows + ggeettoopptt() to be used with programs that expect a number (``-3'') as an op- + tion. This practice is wrong, and should not be used in any current de- + velopment. It is provided for backward compatibility _o_n_l_y. The following + code fragment works in most cases. + + int length; + char *p; + + while ((c = getopt(argc, argv, "0123456789")) != EOF) + switch (c) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + p = argv[optind - 1]; + if (p[0] == '-' && p[1] == ch && !p[2]) + length = atoi(++p); + else + length = atoi(argv[optind] + 1); + break; + } + } + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getpagesize.0 b/usr/share/man/cat3/getpagesize.0 new file mode 100644 index 0000000000..28a90dbcf9 --- /dev/null +++ b/usr/share/man/cat3/getpagesize.0 @@ -0,0 +1,25 @@ +GETPAGESIZE(3) BSD Programmer's Manual GETPAGESIZE(3) + +NNAAMMEE + ggeettppaaggeessiizzee - get system page size + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeettppaaggeessiizzee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + GGeettppaaggeessiizzee() returns the number of bytes in a page. Page granularity is + the granularity of many of the memory management calls. + + The page size is a system page size and may not be the same as the under- + lying hardware page size. + +SSEEEE AALLSSOO + sbrk(2), pagesize(1) + +HHIISSTTOORRYY + The ggeettppaaggeessiizzee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/getpass.0 b/usr/share/man/cat3/getpass.0 new file mode 100644 index 0000000000..cb4ec8cb8e --- /dev/null +++ b/usr/share/man/cat3/getpass.0 @@ -0,0 +1,44 @@ +GETPASS(3) BSD Programmer's Manual GETPASS(3) + +NNAAMMEE + ggeettppaassss - get a password + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _c_h_a_r _* + ggeettppaassss(_c_o_n_s_t _c_h_a_r _*_p_r_o_m_p_t); + +DDEESSCCRRIIPPTTIIOONN + The ggeettppaassss() function displays a prompt to, and reads in a password + from, _/_d_e_v_/_t_t_y. If this file is not accessible, ggeettppaassss displays the + prompt on the standard error output and reads from the standard input. + + The password may be up to _PASSWORD_LEN (currently 128) characters in + length. Any additional characters and the terminating newline character + are discarded. + + GGeettppaassss turns off character echoing while reading the password. + +RREETTUURRNN VVAALLUUEESS + GGeettppaassss returns a pointer to the null terminated password. + +FFIILLEESS + /dev/tty + +SSEEEE AALLSSOO + crypt(3) + +HHIISSTTOORRYY + A ggeettppaassss function appeared in Version 7 AT&T UNIX. + +BBUUGGSS + The ggeettppaassss function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ggeettppaassss will modi- + fy the same object. + + The calling process should zero the password as soon as possible to avoid + leaving the cleartext password visible in the process's address space. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getprotobyname.0 b/usr/share/man/cat3/getprotobyname.0 new file mode 100644 index 0000000000..7fcb0b58f3 --- /dev/null +++ b/usr/share/man/cat3/getprotobyname.0 @@ -0,0 +1,75 @@ +GETPROTOENT(3) BSD Programmer's Manual GETPROTOENT(3) + +NNAAMMEE + ggeettpprroottooeenntt, ggeettpprroottoobbyynnuummbbeerr, ggeettpprroottoobbyynnaammee, sseettpprroottooeenntt, eennddpprroottooeenntt - + get protocol entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottooeenntt(); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnuummbbeerr(_i_n_t _p_r_o_t_o); + + sseettpprroottooeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddpprroottooeenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnaammee(), and ggeettpprroottoobbyynnuummbbeerr() functions + each return a pointer to an object with the following structure contain- + ing the broken-out fields of a line in the network protocol data base, + _/_e_t_c_/_p_r_o_t_o_c_o_l_s. + + + struct protoent { + char *p_name; /* official name of protocol */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ + }; + + The members of this structure are: + + _p___n_a_m_e The official name of the protocol. + + _p___a_l_i_a_s_e_s A zero terminated list of alternate names for the protocol. + + _p___p_r_o_t_o The protocol number. + + The ggeettpprroottooeenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettpprroottooeenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettpprroottoobbyynnaammee() or ggeettpprroottoobbyynnuummbbeerr(). + + The eennddpprroottooeenntt() function closes the file. + + The ggeettpprroottoobbyynnaammee() function and ggeettpprroottoobbyynnuummbbeerr() sequentially search + from the beginning of the file until a matching protocol name or protocol + number is found, or until EOF is encountered. + +RREETTUURRNN VVAALLUUEESS + Null pointer (0) returned on EOF or error. + +FFIILLEESS + /etc/protocols + +SSEEEE AALLSSOO + protocols(5) + +HHIISSTTOORRYY + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnuummbbeerr(), ggeettpprroottoobbyynnaammee(), sseettpprroottooeenntt(), + and eennddpprroottooeenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use a static data space; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet protocols are currently understood. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getprotobynumber.0 b/usr/share/man/cat3/getprotobynumber.0 new file mode 100644 index 0000000000..7fcb0b58f3 --- /dev/null +++ b/usr/share/man/cat3/getprotobynumber.0 @@ -0,0 +1,75 @@ +GETPROTOENT(3) BSD Programmer's Manual GETPROTOENT(3) + +NNAAMMEE + ggeettpprroottooeenntt, ggeettpprroottoobbyynnuummbbeerr, ggeettpprroottoobbyynnaammee, sseettpprroottooeenntt, eennddpprroottooeenntt - + get protocol entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottooeenntt(); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnuummbbeerr(_i_n_t _p_r_o_t_o); + + sseettpprroottooeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddpprroottooeenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnaammee(), and ggeettpprroottoobbyynnuummbbeerr() functions + each return a pointer to an object with the following structure contain- + ing the broken-out fields of a line in the network protocol data base, + _/_e_t_c_/_p_r_o_t_o_c_o_l_s. + + + struct protoent { + char *p_name; /* official name of protocol */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ + }; + + The members of this structure are: + + _p___n_a_m_e The official name of the protocol. + + _p___a_l_i_a_s_e_s A zero terminated list of alternate names for the protocol. + + _p___p_r_o_t_o The protocol number. + + The ggeettpprroottooeenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettpprroottooeenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettpprroottoobbyynnaammee() or ggeettpprroottoobbyynnuummbbeerr(). + + The eennddpprroottooeenntt() function closes the file. + + The ggeettpprroottoobbyynnaammee() function and ggeettpprroottoobbyynnuummbbeerr() sequentially search + from the beginning of the file until a matching protocol name or protocol + number is found, or until EOF is encountered. + +RREETTUURRNN VVAALLUUEESS + Null pointer (0) returned on EOF or error. + +FFIILLEESS + /etc/protocols + +SSEEEE AALLSSOO + protocols(5) + +HHIISSTTOORRYY + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnuummbbeerr(), ggeettpprroottoobbyynnaammee(), sseettpprroottooeenntt(), + and eennddpprroottooeenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use a static data space; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet protocols are currently understood. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getprotoent.0 b/usr/share/man/cat3/getprotoent.0 new file mode 100644 index 0000000000..7fcb0b58f3 --- /dev/null +++ b/usr/share/man/cat3/getprotoent.0 @@ -0,0 +1,75 @@ +GETPROTOENT(3) BSD Programmer's Manual GETPROTOENT(3) + +NNAAMMEE + ggeettpprroottooeenntt, ggeettpprroottoobbyynnuummbbeerr, ggeettpprroottoobbyynnaammee, sseettpprroottooeenntt, eennddpprroottooeenntt - + get protocol entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottooeenntt(); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnuummbbeerr(_i_n_t _p_r_o_t_o); + + sseettpprroottooeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddpprroottooeenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnaammee(), and ggeettpprroottoobbyynnuummbbeerr() functions + each return a pointer to an object with the following structure contain- + ing the broken-out fields of a line in the network protocol data base, + _/_e_t_c_/_p_r_o_t_o_c_o_l_s. + + + struct protoent { + char *p_name; /* official name of protocol */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ + }; + + The members of this structure are: + + _p___n_a_m_e The official name of the protocol. + + _p___a_l_i_a_s_e_s A zero terminated list of alternate names for the protocol. + + _p___p_r_o_t_o The protocol number. + + The ggeettpprroottooeenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettpprroottooeenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettpprroottoobbyynnaammee() or ggeettpprroottoobbyynnuummbbeerr(). + + The eennddpprroottooeenntt() function closes the file. + + The ggeettpprroottoobbyynnaammee() function and ggeettpprroottoobbyynnuummbbeerr() sequentially search + from the beginning of the file until a matching protocol name or protocol + number is found, or until EOF is encountered. + +RREETTUURRNN VVAALLUUEESS + Null pointer (0) returned on EOF or error. + +FFIILLEESS + /etc/protocols + +SSEEEE AALLSSOO + protocols(5) + +HHIISSTTOORRYY + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnuummbbeerr(), ggeettpprroottoobbyynnaammee(), sseettpprroottooeenntt(), + and eennddpprroottooeenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use a static data space; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet protocols are currently understood. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getpwent.0 b/usr/share/man/cat3/getpwent.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/getpwent.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/getpwnam.0 b/usr/share/man/cat3/getpwnam.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/getpwnam.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/getpwuid.0 b/usr/share/man/cat3/getpwuid.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/getpwuid.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/gets.0 b/usr/share/man/cat3/gets.0 new file mode 100644 index 0000000000..2d35b9c978 --- /dev/null +++ b/usr/share/man/cat3/gets.0 @@ -0,0 +1,58 @@ +FGETS(3) BSD Programmer's Manual FGETS(3) + +NNAAMMEE + ffggeettss, ggeettss - get a line from a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ffggeettss(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _F_I_L_E _*_s_t_r_e_a_m); + + _c_h_a_r _* + ggeettss(_c_h_a_r _*_s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettss() function reads at most one less than the number of characters + specified by size from the given _s_t_r_e_a_m and stores them in the string + _s_t_r. Reading stops when a newline character is found, at end-of-file or + error. The newline, if any, is retained. In any case a `\0' character + is appended to end the string. + + The ggeettss() function is equivalent to ffggeettss() with an infinite size and a + _s_t_r_e_a_m of _s_t_d_i_n, except that the newline character (if any) is not stored + in the string. It is the caller's responsibility to ensure that the in- + put line, if any, is sufficiently short to fit in the string. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, ffggeettss() and ggeettss() return a pointer to the + string. If end-of-file or an error occurs before any characters are + read, they return NULL. The ffggeettss() and functions ggeettss() do not distin- + guish between end-of-file and error, and callers must use feof(3) and + ferror(3) to determine which occurred. + +EERRRROORRSS + [EBADF] The given _s_t_r_e_a_m is not a readable stream. + + The function ffggeettss() may also fail and set _e_r_r_n_o for any of the errors + specified for the routines fflush(3), fstat(2), read(2), or malloc(3). + + + The function ggeettss() may also fail and set _e_r_r_n_o for any of the errors + specified for the routine getchar(3). + +SSEEEE AALLSSOO + feof(3), ferror(3), fgetline(3) + +SSTTAANNDDAARRDDSS + The functions ffggeettss() and ggeettss() conform to ANSI C X3.159-1989 (``ANSI C + ''). + +BBUUGGSS + Since it is usually impossible to ensure that the next input line is less + than some arbitrary length, and because overflowing the input buffer is + almost invariably a security violation, programs should _N_E_V_E_R use ggeettss(). + The ggeettss() function exists purely to conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/getservbyname.0 b/usr/share/man/cat3/getservbyname.0 new file mode 100644 index 0000000000..d1f930be56 --- /dev/null +++ b/usr/share/man/cat3/getservbyname.0 @@ -0,0 +1,83 @@ +GETSERVENT(3) BSD Programmer's Manual GETSERVENT(3) + +NNAAMMEE + ggeettsseerrvveenntt, ggeettsseerrvvbbyyppoorrtt, ggeettsseerrvvbbyynnaammee, sseettsseerrvveenntt, eennddsseerrvveenntt - get + service entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvveenntt(); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyynnaammee(_c_h_a_r _*_n_a_m_e, _c_h_a_r _*_p_r_o_t_o); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyyppoorrtt(_i_n_t _p_o_r_t, _p_r_o_t_o); + + _v_o_i_d + sseettsseerrvveenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _v_o_i_d + eennddsseerrvveenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyynnaammee(), and ggeettsseerrvvbbyyppoorrtt() functions each re- + turn a pointer to an object with the following structure containing the + broken-out fields of a line in the network services data base, + _/_e_t_c_/_s_e_r_v_i_c_e_s. + + struct servent { + char *s_name; /* official name of service */ + char **s_aliases; /* alias list */ + int s_port; /* port service resides at */ + char *s_proto; /* protocol to use */ + }; + + The members of this structure are: + + _s___n_a_m_e The official name of the service. + + _s___a_l_i_a_s_e_s A zero terminated list of alternate names for the service. + + _s___p_o_r_t The port number at which the service resides. Port numbers + are returned in network byte order. + + _s___p_r_o_t_o The name of the protocol to use when contacting the service. + + The ggeettsseerrvveenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettsseerrvveenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettsseerrvvbbyynnaammee() or ggeettsseerrvvbbyyppoorrtt(). + + The eennddsseerrvveenntt() function closes the file. + + The ggeettsseerrvvbbyynnaammee() and ggeettsseerrvvbbyyppoorrtt() functions sequentially search + from the beginning of the file until a matching protocol name or port + number is found, or until EOF is encountered. If a protocol name is also + supplied (non- NULL), searches must also match the protocol. + +FFIILLEESS + + + /etc/services + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + getprotoent(3), services(5) + +HHIISSTTOORRYY + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyyppoorrtt(), ggeettsseerrvvbbyynnaammee(), sseettsseerrvveenntt(), and + eennddsseerrvveenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Ex- + pecting port numbers to fit in a 32 bit quantity is probably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getservbyport.0 b/usr/share/man/cat3/getservbyport.0 new file mode 100644 index 0000000000..d1f930be56 --- /dev/null +++ b/usr/share/man/cat3/getservbyport.0 @@ -0,0 +1,83 @@ +GETSERVENT(3) BSD Programmer's Manual GETSERVENT(3) + +NNAAMMEE + ggeettsseerrvveenntt, ggeettsseerrvvbbyyppoorrtt, ggeettsseerrvvbbyynnaammee, sseettsseerrvveenntt, eennddsseerrvveenntt - get + service entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvveenntt(); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyynnaammee(_c_h_a_r _*_n_a_m_e, _c_h_a_r _*_p_r_o_t_o); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyyppoorrtt(_i_n_t _p_o_r_t, _p_r_o_t_o); + + _v_o_i_d + sseettsseerrvveenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _v_o_i_d + eennddsseerrvveenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyynnaammee(), and ggeettsseerrvvbbyyppoorrtt() functions each re- + turn a pointer to an object with the following structure containing the + broken-out fields of a line in the network services data base, + _/_e_t_c_/_s_e_r_v_i_c_e_s. + + struct servent { + char *s_name; /* official name of service */ + char **s_aliases; /* alias list */ + int s_port; /* port service resides at */ + char *s_proto; /* protocol to use */ + }; + + The members of this structure are: + + _s___n_a_m_e The official name of the service. + + _s___a_l_i_a_s_e_s A zero terminated list of alternate names for the service. + + _s___p_o_r_t The port number at which the service resides. Port numbers + are returned in network byte order. + + _s___p_r_o_t_o The name of the protocol to use when contacting the service. + + The ggeettsseerrvveenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettsseerrvveenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettsseerrvvbbyynnaammee() or ggeettsseerrvvbbyyppoorrtt(). + + The eennddsseerrvveenntt() function closes the file. + + The ggeettsseerrvvbbyynnaammee() and ggeettsseerrvvbbyyppoorrtt() functions sequentially search + from the beginning of the file until a matching protocol name or port + number is found, or until EOF is encountered. If a protocol name is also + supplied (non- NULL), searches must also match the protocol. + +FFIILLEESS + + + /etc/services + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + getprotoent(3), services(5) + +HHIISSTTOORRYY + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyyppoorrtt(), ggeettsseerrvvbbyynnaammee(), sseettsseerrvveenntt(), and + eennddsseerrvveenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Ex- + pecting port numbers to fit in a 32 bit quantity is probably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getservent.0 b/usr/share/man/cat3/getservent.0 new file mode 100644 index 0000000000..d1f930be56 --- /dev/null +++ b/usr/share/man/cat3/getservent.0 @@ -0,0 +1,83 @@ +GETSERVENT(3) BSD Programmer's Manual GETSERVENT(3) + +NNAAMMEE + ggeettsseerrvveenntt, ggeettsseerrvvbbyyppoorrtt, ggeettsseerrvvbbyynnaammee, sseettsseerrvveenntt, eennddsseerrvveenntt - get + service entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvveenntt(); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyynnaammee(_c_h_a_r _*_n_a_m_e, _c_h_a_r _*_p_r_o_t_o); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyyppoorrtt(_i_n_t _p_o_r_t, _p_r_o_t_o); + + _v_o_i_d + sseettsseerrvveenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _v_o_i_d + eennddsseerrvveenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyynnaammee(), and ggeettsseerrvvbbyyppoorrtt() functions each re- + turn a pointer to an object with the following structure containing the + broken-out fields of a line in the network services data base, + _/_e_t_c_/_s_e_r_v_i_c_e_s. + + struct servent { + char *s_name; /* official name of service */ + char **s_aliases; /* alias list */ + int s_port; /* port service resides at */ + char *s_proto; /* protocol to use */ + }; + + The members of this structure are: + + _s___n_a_m_e The official name of the service. + + _s___a_l_i_a_s_e_s A zero terminated list of alternate names for the service. + + _s___p_o_r_t The port number at which the service resides. Port numbers + are returned in network byte order. + + _s___p_r_o_t_o The name of the protocol to use when contacting the service. + + The ggeettsseerrvveenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettsseerrvveenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettsseerrvvbbyynnaammee() or ggeettsseerrvvbbyyppoorrtt(). + + The eennddsseerrvveenntt() function closes the file. + + The ggeettsseerrvvbbyynnaammee() and ggeettsseerrvvbbyyppoorrtt() functions sequentially search + from the beginning of the file until a matching protocol name or port + number is found, or until EOF is encountered. If a protocol name is also + supplied (non- NULL), searches must also match the protocol. + +FFIILLEESS + + + /etc/services + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + getprotoent(3), services(5) + +HHIISSTTOORRYY + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyyppoorrtt(), ggeettsseerrvvbbyynnaammee(), sseettsseerrvveenntt(), and + eennddsseerrvveenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Ex- + pecting port numbers to fit in a 32 bit quantity is probably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getsubopt.0 b/usr/share/man/cat3/getsubopt.0 new file mode 100644 index 0000000000..c333a07a74 --- /dev/null +++ b/usr/share/man/cat3/getsubopt.0 @@ -0,0 +1,89 @@ +GETSUBOPT(3) BSD Programmer's Manual GETSUBOPT(3) + +NNAAMMEE + ggeettssuubboopptt - get sub options from an argument + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_s_u_b_o_p_t_a_r_g + + _i_n_t + ggeettssuubboopptt(_c_h_a_r _*_*_o_p_t_i_o_n_p, _c_h_a_r _* _c_o_n_s_t _*_t_o_k_e_n_s, _c_h_a_r _*_*_v_a_l_u_e_p); + +DDEESSCCRRIIPPTTIIOONN + The ggeettssuubboopptt() function parses a string containing tokens delimited by + one or more tab, space or comma (`,') characters. It is intended for use + in parsing groups of option arguments provided as part of a utility com- + mand line. + + The argument _o_p_t_i_o_n_p is a pointer to a pointer to the string. The argu- + ment _t_o_k_e_n_s is a pointer to a NULL-terminated array of pointers to + strings. + + The ggeettssuubboopptt() function returns the zero-based offset of the pointer in + the _t_o_k_e_n_s array referencing a string which matches the first token in + the string, or, -1 if the string contains no tokens or _t_o_k_e_n_s does not + contain a matching string. + + If the token is of the form ``name=value'', the location referenced by + _v_a_l_u_e_p will be set to point to the start of the ``value'' portion of the + token. + + On return from ggeettssuubboopptt(), _o_p_t_i_o_n_p will be set to point to the start of + the next token in the string, or the null at the end of the string if no + more tokens are present. The external variable _s_u_b_o_p_t_a_r_g will be set to + point to the start of the current token, or NULL if no tokens were pre- + sent. The argument _v_a_l_u_e_p will be set to point to the ``value'' portion + of the token, or NULL if no ``value'' portion was present. + +EEXXAAMMPPLLEE + char *tokens[] = { + #define ONE 0 + "one", + #define TWO 1 + "two", + NULL + }; + + ... + + extern char *optarg, *suboptarg; + char *options, *value; + + while ((ch = getopt(argc, argv, "ab:")) != -1) { + switch(ch) { + case 'a': + /* process ``a'' option */ + break; + case 'b': + options = optarg; + while (*options) { + switch(getsubopt(&options, tokens, &value)) { + case ONE: + /* process ``one'' sub option */ + break; + case TWO: + /* process ``two'' sub option */ + if (!value) + error("no value for two"); + i = atoi(value); + break; + case -1: + if (suboptarg) + error("illegal sub option %s", + suboptarg); + else + error("missing sub option"); + break; + } + break; + } + +SSEEEE AALLSSOO + getopt(3), strsep(3) + +HHIISSTTOORRYY + The ggeettssuubboopptt() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/getttyent.0 b/usr/share/man/cat3/getttyent.0 new file mode 100644 index 0000000000..5013ee00ef --- /dev/null +++ b/usr/share/man/cat3/getttyent.0 @@ -0,0 +1,98 @@ +GETTTYENT(3) BSD Programmer's Manual GETTTYENT(3) + +NNAAMMEE + ggeettttttyyeenntt, ggeettttttyynnaamm, sseettttttyyeenntt, eennddttttyyeenntt - get ttys file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyyeenntt(); + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyynnaamm(_c_h_a_r _*_n_a_m_e); + + _i_n_t + sseettttttyyeenntt(_v_o_i_d); + + _i_n_t + eennddttttyyeenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettttttyyeenntt(), and ggeettttttyynnaamm() functions each return a pointer to an + object, with the following structure, containing the broken-out fields of + a line from the tty description file. + + struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute */ + char *ty_type; /* terminal type */ + #define TTY_ON 0x01 /* enable logins */ + #define TTY_SECURE 0x02 /* allow uid of 0 to login */ + int ty_status; /* flag values */ + char *ty_window; /* command for window manager */ + char *ty_comment; /* comment field */ + }; + + The fields are as follows: + + _t_y___n_a_m_e The name of the character-special file. + + _t_y___g_e_t_t_y The name of the command invoked by init(8) to initialize tty + line characteristics. + + _t_y___t_y_p_e The name of the default terminal type connected to this tty + line. + + _t_y___s_t_a_t_u_s A mask of bit fields which indicate various actions allowed + on this tty line. The possible flags are as follows: + + TTY_ON Enables logins (i.e., init(8) will start the com- + mand referenced by _t_y___g_e_t_t_y on this entry). + + TTY_SECURE Allow users with a uid of 0 to login on this ter- + minal. + + _t_y___w_i_n_d_o_w The command to execute for a window system associated with + the line. + + _t_y___c_o_m_m_e_n_t Any trailing comment field, with any leading hash marks + (``#'') or whitespace removed. + + If any of the fields pointing to character strings are unspecified, they + are returned as null pointers. The field _t_y___s_t_a_t_u_s will be zero if no + flag values are specified. + + + See ttys(5) for a more complete discussion of the meaning and usage of + the fields. + + The ggeettttttyyeenntt() function reads the next line from the ttys file, opening + the file if necessary. The sseettttttyyeenntt() function rewinds the file if + open, or opens the file if it is unopened. The eennddttttyyeenntt() function + closes any open files. + + The ggeettttttyynnaamm() function searches from the beginning of the file until a + matching _n_a_m_e is found (or until EOF is encountered). + +RREETTUURRNN VVAALLUUEESS + The routines ggeettttttyyeenntt() and ggeettttttyynnaamm() return a null pointer on EOF or + error. The sseettttttyyeenntt() function and eennddttttyyeenntt() return 0 on failure and + 1 on success. + +FFIILLEESS + /etc/ttys + +SSEEEE AALLSSOO + login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), + init(8) + +HHIISSTTOORRYY + The ggeettttttyyeenntt(), ggeettttttyynnaamm(), sseettttttyyeenntt(), and eennddttttyyeenntt() functions ap- + peared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getttynam.0 b/usr/share/man/cat3/getttynam.0 new file mode 100644 index 0000000000..5013ee00ef --- /dev/null +++ b/usr/share/man/cat3/getttynam.0 @@ -0,0 +1,98 @@ +GETTTYENT(3) BSD Programmer's Manual GETTTYENT(3) + +NNAAMMEE + ggeettttttyyeenntt, ggeettttttyynnaamm, sseettttttyyeenntt, eennddttttyyeenntt - get ttys file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyyeenntt(); + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyynnaamm(_c_h_a_r _*_n_a_m_e); + + _i_n_t + sseettttttyyeenntt(_v_o_i_d); + + _i_n_t + eennddttttyyeenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettttttyyeenntt(), and ggeettttttyynnaamm() functions each return a pointer to an + object, with the following structure, containing the broken-out fields of + a line from the tty description file. + + struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute */ + char *ty_type; /* terminal type */ + #define TTY_ON 0x01 /* enable logins */ + #define TTY_SECURE 0x02 /* allow uid of 0 to login */ + int ty_status; /* flag values */ + char *ty_window; /* command for window manager */ + char *ty_comment; /* comment field */ + }; + + The fields are as follows: + + _t_y___n_a_m_e The name of the character-special file. + + _t_y___g_e_t_t_y The name of the command invoked by init(8) to initialize tty + line characteristics. + + _t_y___t_y_p_e The name of the default terminal type connected to this tty + line. + + _t_y___s_t_a_t_u_s A mask of bit fields which indicate various actions allowed + on this tty line. The possible flags are as follows: + + TTY_ON Enables logins (i.e., init(8) will start the com- + mand referenced by _t_y___g_e_t_t_y on this entry). + + TTY_SECURE Allow users with a uid of 0 to login on this ter- + minal. + + _t_y___w_i_n_d_o_w The command to execute for a window system associated with + the line. + + _t_y___c_o_m_m_e_n_t Any trailing comment field, with any leading hash marks + (``#'') or whitespace removed. + + If any of the fields pointing to character strings are unspecified, they + are returned as null pointers. The field _t_y___s_t_a_t_u_s will be zero if no + flag values are specified. + + + See ttys(5) for a more complete discussion of the meaning and usage of + the fields. + + The ggeettttttyyeenntt() function reads the next line from the ttys file, opening + the file if necessary. The sseettttttyyeenntt() function rewinds the file if + open, or opens the file if it is unopened. The eennddttttyyeenntt() function + closes any open files. + + The ggeettttttyynnaamm() function searches from the beginning of the file until a + matching _n_a_m_e is found (or until EOF is encountered). + +RREETTUURRNN VVAALLUUEESS + The routines ggeettttttyyeenntt() and ggeettttttyynnaamm() return a null pointer on EOF or + error. The sseettttttyyeenntt() function and eennddttttyyeenntt() return 0 on failure and + 1 on success. + +FFIILLEESS + /etc/ttys + +SSEEEE AALLSSOO + login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), + init(8) + +HHIISSTTOORRYY + The ggeettttttyyeenntt(), ggeettttttyynnaamm(), sseettttttyyeenntt(), and eennddttttyyeenntt() functions ap- + peared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/getusershell.0 b/usr/share/man/cat3/getusershell.0 new file mode 100644 index 0000000000..665697eb6e --- /dev/null +++ b/usr/share/man/cat3/getusershell.0 @@ -0,0 +1,42 @@ +GETUSERSHELL(3) BSD Programmer's Manual GETUSERSHELL(3) + +NNAAMMEE + ggeettuusseerrsshheellll, sseettuusseerrsshheellll, eenndduusseerrsshheellll - get legal user shells + +SSYYNNOOPPSSIISS + _c_h_a_r _* + ggeettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + sseettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + eenndduusseerrsshheellll(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettuusseerrsshheellll() function returns a pointer to a legal user shell as + defined by the system manager in the file _/_e_t_c_/_s_h_e_l_l_s. If _/_e_t_c_/_s_h_e_l_l_s is + unreadable or does not exist, ggeettuusseerrsshheellll() behaves as if _/_b_i_n_/_s_h and + _/_b_i_n_/_c_s_h were listed in the file. + + The ggeettuusseerrsshheellll() function reads the next line (opening the file if nec- + essary); sseettuusseerrsshheellll() rewinds the file; eenndduusseerrsshheellll() closes it. + +FFIILLEESS + /etc/shells + +DDIIAAGGNNOOSSTTIICCSS + The routine ggeettuusseerrsshheellll() returns a null pointer (0) on EOF. + +SSEEEE AALLSSOO + shells(5) + +HHIISSTTOORRYY + The ggeettuusseerrsshheellll() function appeared in 4.3BSD. + +BBUUGGSS + The ggeettuusseerrsshheellll() function leaves its result in an internal static ob- + ject and returns a pointer to that object. Subsequent calls to + ggeettuusseerrsshheellll() will modify the same object. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/getw.0 b/usr/share/man/cat3/getw.0 new file mode 100644 index 0000000000..69b529360b --- /dev/null +++ b/usr/share/man/cat3/getw.0 @@ -0,0 +1,56 @@ +GETC(3) BSD Programmer's Manual GETC(3) + +NNAAMMEE + ffggeettcc, ggeettcc, ggeettcchhaarr, ggeettww - get next character or word from input stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcc(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ggeettcchhaarr(); + + _i_n_t + ggeettww(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffggeettcc() function obtains the next input character (if present) from + the stream pointed at by _s_t_r_e_a_m, or the next character pushed back on the + stream via ungetc. + + The ggeettcc() function acts essentially identically to ffggeettcc(), but is a + macro that expands in-line. + + The ggeettcchhaarr() function is equivalent to: getc with the argument stdin. + + The ggeettww() function obtains the next _i_n_t (if present) from the stream + pointed at by _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + If successful, these routines return the next requested object from the + _s_t_r_e_a_m. If the stream is at end-of-file or a read error occurs, the rou- + tines return EOF. The routines feof(3) and ferror(3) must be used to dis- + tinguish between end-of-file and error. If an error occurs, the global + variable _e_r_r_n_o is set to indicate the error. The end-of-file condition + is remembered, even on a terminal, and all subsequent attempts to read + will return EOF until the condition is cleared with clearerr. + +SSEEEE AALLSSOO + ferror(3), fread(3), fopen(3), putc(3), ungetc(3) + +SSTTAANNDDAARRDDSS + The ffggeettcc(), ggeettcc() and ggeettcchhaarr() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + Since EOF is a valid integer value, feof and ferror must be used to check + for failure after calling ggeettww(). The size and byte order of an _i_n_t + varies from one machine to another, and ggeettww() is not recommended for + portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/glob.0 b/usr/share/man/cat3/glob.0 new file mode 100644 index 0000000000..8f6c5f90bc --- /dev/null +++ b/usr/share/man/cat3/glob.0 @@ -0,0 +1,210 @@ +GLOB(3) BSD Programmer's Manual GLOB(3) + +NNAAMMEE + gglloobb, gglloobbffrreeee - generate pathnames matching a pattern + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + gglloobb(_c_o_n_s_t _c_h_a_r _*_p_a_t_t_e_r_n, _i_n_t _f_l_a_g_s, + _c_o_n_s_t _i_n_t _(_*_e_r_r_f_u_n_c_)_(_c_o_n_s_t _c_h_a_r _*_, _i_n_t_), _g_l_o_b___t _*_p_g_l_o_b); + + _v_o_i_d + gglloobbffrreeee(_g_l_o_b___t _*_p_g_l_o_b); + +DDEESSCCRRIIPPTTIIOONN + The gglloobb() function is a pathname generator that implements the rules for + file name pattern matching used by the shell. + + The include file _g_l_o_b_._h defines the structure type _g_l_o_b___t, which contains + at least the following fields: + + typedef struct { + int gl_pathc; /* count of total paths so far */ + int gl_matchc; /* count of paths matching pattern */ + int gl_offs; /* reserved at beginning of gl_pathv */ + int gl_flags; /* returned flags */ + char **gl_pathv; /* list of paths matching pattern */ + } glob_t; + + The argument _p_a_t_t_e_r_n is a pointer to a pathname pattern to be expanded. + The gglloobb() argument matches all accessible pathnames against the pattern + and creates a list of the pathnames that match. In order to have access + to a pathname, gglloobb() requires search permission on every component of a + path except the last and read permission on each directory of any file- + name component of _p_a_t_t_e_r_n that contains any of the special characters + `*', `?' or `['. + + The gglloobb() argument stores the number of matched pathnames into the + _g_l___p_a_t_h_c field, and a pointer to a list of pointers to pathnames into the + _g_l___p_a_t_h_v field. The first pointer after the last pathname is NULL. If + the pattern does not match any pathnames, the returned number of matched + paths is set to zero. + + It is the caller's responsibility to create the structure pointed to by + _p_g_l_o_b. The gglloobb() function allocates other space as needed, including the + memory pointed to by _g_l___p_a_t_h_v. + + The argument _f_l_a_g_s is used to modify the behavior of gglloobb(). The value + of _f_l_a_g_s is the bitwise inclusive OR of any of the following values de- + fined in _g_l_o_b_._h: + + GLOB_APPEND Append pathnames generated to the ones from a previous + call (or calls) to gglloobb(). The value of _g_l___p_a_t_h_c will + be the total matches found by this call and the previous + call(s). The pathnames are appended to, not merged with + the pathnames returned by the previous call(s). Between + calls, the caller must not change the setting of the + GLOB_DOOFFS flag, nor change the value of _g_l___o_f_f_s when + GLOB_DOOFFS is set, nor (obviously) call gglloobbffrreeee() for + _p_g_l_o_b. + + GLOB_DOOFFS Make use of the _g_l___o_f_f_s field. If this flag is set, + _g_l___o_f_f_s is used to specify how many NULL pointers to + prepend to the beginning of the _g_l___p_a_t_h_v field. In oth- + er words, _g_l___p_a_t_h_v will point to _g_l___o_f_f_s NULL pointers, + followed by _g_l___p_a_t_h_c pathname pointers, followed by a + NULL pointer. + + GLOB_ERR Causes gglloobb() to return when it encounters a directory + that it cannot open or read. Ordinarily, gglloobb() contin- + ues to find matches. + + GLOB_MARK Each pathname that is a directory that matches _p_a_t_t_e_r_n + has a slash appended. + + GLOB_NOCHECK If _p_a_t_t_e_r_n does not match any pathname, then gglloobb() re- + turns a list consisting of only _p_a_t_t_e_r_n, with the number + of total pathnames is set to 1, and the number of + matched pathnames set to 0. If GLOB_QUOTE is set, its + effect is present in the pattern returned. + + GLOB_NOSORT By default, the pathnames are sorted in ascending ASCII + order; this flag prevents that sorting (speeding up + gglloobb()). + + The following values may also be included in _f_l_a_g_s, however, they are + non-standard extensions to IEEE Std1003.2 (``POSIX''). + + GLOB_ALTDIRFUNC The following additional fields in the pglob structure + have been initialized with alternate functions for glob + to use to open, read, and close directories and to get + stat information on names found in those directories. + + void *(*gl_opendir)(const char * name); + struct dirent *(*gl_readdir)(void *); + void (*gl_closedir)(void *); + int (*gl_lstat)(const char *name, struct stat *st); + int (*gl_stat)(const char *name, struct stat *st); + + This extension is provided to allow programs such as re- + store(8) to provide globbing from directories stored on + tape. + + GLOB_BRACE Pre-process the pattern string to expand `{pat,pat,...}' + strings like csh(1.)The pattern `{}' is left unexpanded + for historical reasons (Csh(1) does the same thing to + ease typing of find(1) patterns). + + GLOB_MAGCHAR Set by the gglloobb() function if the pattern included glob- + bing characters. See the description of the usage of + the _g_l___m_a_t_c_h_c structure member for more details. + + GLOB_NOMAGIC Is the same as GLOB_NOCHECK but it only appends the + _p_a_t_t_e_r_n if it does not contain any of the special char- + acters ``*'', ``?'' or ``[''. GLOB_NOMAGIC is provided + to simplify implementing the historic csh(1) globbing + behavior and should probably not be used anywhere else. + + GLOB_QUOTE Use the backslash (`\') character for quoting: every oc- + currence of a backslash followed by a character in the + pattern is replaced by that character, avoiding any spe- + cial interpretation of the character. + + GLOB_TILDE Expand patterns that start with `~' to user name home + directories. + + If, during the search, a directory is encountered that cannot be opened + or read and _e_r_r_f_u_n_c is non-NULL, gglloobb() calls _(_*_e_r_r_f_u_n_c_)_(_p_a_t_h_, _e_r_r_n_o_). + This may be unintuitive: a pattern like `*/Makefile' will try to stat(2) + `foo/Makefile' even if `foo' is not a directory, resulting in a call to + _e_r_r_f_u_n_c. The error routine can suppress this action by testing for ENOENT + and ENOTDIR; however, the GLOB_ERR flag will still cause an immediate re- + turn when this happens. + + If _e_r_r_f_u_n_c returns non-zero, gglloobb() stops the scan and returns GLOB_ABEND + after setting _g_l___p_a_t_h_c and _g_l___p_a_t_h_v to reflect any paths already matched. + This also happens if an error is encountered and GLOB_ERR is set in + _f_l_a_g_s, regardless of the return value of _e_r_r_f_u_n_c, if called. If GLOB_ERR + is not set and either _e_r_r_f_u_n_c is NULL or _e_r_r_f_u_n_c returns zero, the error + is ignored. + + The gglloobbffrreeee() function frees any space associated with _p_g_l_o_b from a pre- + vious call(s) to gglloobb(). + +RREETTUURRNN VVAALLUUEESS + On successful completion, gglloobb() returns zero. In addition the fields of + _p_g_l_o_b contain the values described below: + + _g_l___p_a_t_h_c contains the total number of matched pathnames so far. + This includes other matches from previous invocations of + gglloobb() if GLOB_APPEND was specified. + + _g_l___m_a_t_c_h_c contains the number of matched pathnames in the current in- + vocation of gglloobb(). + + _g_l___f_l_a_g_s contains a copy of the _f_l_a_g_s parameter with the bit + GLOB_MAGCHAR set if _p_a_t_t_e_r_n contained any of the special + characters ``*'', ``?'' or ``['', cleared if not. + + _g_l___p_a_t_h_v contains a pointer to a NULL-terminated list of matched + pathnames. However, if _g_l___p_a_t_h_c is zero, the contents of + _g_l___p_a_t_h_v are undefined. + + If gglloobb() terminates due to an error, it sets errno and returns one of + the following non-zero constants, which are defined in the include file + <_g_l_o_b_._h>: + + GLOB_NOSPACE An attempt to allocate memory failed. + + GLOB_ABEND The scan was stopped because an error was encountered and + either GLOB_ERR was set or _(_*_e_r_r_f_u_n_c_)_(_) returned non-zero. + + The arguments _p_g_l_o_b_-_>_g_l___p_a_t_h_c and _p_g_l_o_b_-_>_g_l___p_a_t_h_v are still set as speci- + fied above. + +SSEEEE AALLSSOO + sh(1), fnmatch(3), wordexp(3), regexp(3) + +SSTTAANNDDAARRDDSS + The gglloobb() function is expected to be IEEE Std1003.2 (``POSIX'') compati- + ble with the exception that the flags GLOB_ALTDIRFUNC, GLOB_BRACE + GLOB_MAGCHAR, GLOB_NOMAGIC, GLOB_QUOTE, and GLOB_TILDE, and the fields + _g_l___m_a_t_c_h_c and _g_l___f_l_a_g_s should not be used by applications striving for + strict POSIX conformance. + +EEXXAAMMPPLLEE + A rough equivalent of `ls -l *.c *.h' can be obtained with the following + code: + + GLOB_t g; + + g.gl_offs = 2; + glob("*.c", GLOB_DOOFFS, NULL, &g); + glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g); + g.gl_pathv[0] = "ls"; + g.gl_pathv[1] = "-l"; + execvp("ls", g.gl_pathv); + +HHIISSTTOORRYY + The gglloobb() and gglloobbffrreeee() functions first appeared in 4.4BSD. + +BBUUGGSS + Patterns longer than MAXPATHLEN may cause unchecked errors. + + The gglloobb() argument may fail and set errno for any of the errors speci- + fied for the library routines stat(2), closedir(3), opendir(3), + readdir(3), malloc(3), and free(3). + +4.4BSD June 9, 1993 4 diff --git a/usr/share/man/cat3/globfree.0 b/usr/share/man/cat3/globfree.0 new file mode 100644 index 0000000000..8f6c5f90bc --- /dev/null +++ b/usr/share/man/cat3/globfree.0 @@ -0,0 +1,210 @@ +GLOB(3) BSD Programmer's Manual GLOB(3) + +NNAAMMEE + gglloobb, gglloobbffrreeee - generate pathnames matching a pattern + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + gglloobb(_c_o_n_s_t _c_h_a_r _*_p_a_t_t_e_r_n, _i_n_t _f_l_a_g_s, + _c_o_n_s_t _i_n_t _(_*_e_r_r_f_u_n_c_)_(_c_o_n_s_t _c_h_a_r _*_, _i_n_t_), _g_l_o_b___t _*_p_g_l_o_b); + + _v_o_i_d + gglloobbffrreeee(_g_l_o_b___t _*_p_g_l_o_b); + +DDEESSCCRRIIPPTTIIOONN + The gglloobb() function is a pathname generator that implements the rules for + file name pattern matching used by the shell. + + The include file _g_l_o_b_._h defines the structure type _g_l_o_b___t, which contains + at least the following fields: + + typedef struct { + int gl_pathc; /* count of total paths so far */ + int gl_matchc; /* count of paths matching pattern */ + int gl_offs; /* reserved at beginning of gl_pathv */ + int gl_flags; /* returned flags */ + char **gl_pathv; /* list of paths matching pattern */ + } glob_t; + + The argument _p_a_t_t_e_r_n is a pointer to a pathname pattern to be expanded. + The gglloobb() argument matches all accessible pathnames against the pattern + and creates a list of the pathnames that match. In order to have access + to a pathname, gglloobb() requires search permission on every component of a + path except the last and read permission on each directory of any file- + name component of _p_a_t_t_e_r_n that contains any of the special characters + `*', `?' or `['. + + The gglloobb() argument stores the number of matched pathnames into the + _g_l___p_a_t_h_c field, and a pointer to a list of pointers to pathnames into the + _g_l___p_a_t_h_v field. The first pointer after the last pathname is NULL. If + the pattern does not match any pathnames, the returned number of matched + paths is set to zero. + + It is the caller's responsibility to create the structure pointed to by + _p_g_l_o_b. The gglloobb() function allocates other space as needed, including the + memory pointed to by _g_l___p_a_t_h_v. + + The argument _f_l_a_g_s is used to modify the behavior of gglloobb(). The value + of _f_l_a_g_s is the bitwise inclusive OR of any of the following values de- + fined in _g_l_o_b_._h: + + GLOB_APPEND Append pathnames generated to the ones from a previous + call (or calls) to gglloobb(). The value of _g_l___p_a_t_h_c will + be the total matches found by this call and the previous + call(s). The pathnames are appended to, not merged with + the pathnames returned by the previous call(s). Between + calls, the caller must not change the setting of the + GLOB_DOOFFS flag, nor change the value of _g_l___o_f_f_s when + GLOB_DOOFFS is set, nor (obviously) call gglloobbffrreeee() for + _p_g_l_o_b. + + GLOB_DOOFFS Make use of the _g_l___o_f_f_s field. If this flag is set, + _g_l___o_f_f_s is used to specify how many NULL pointers to + prepend to the beginning of the _g_l___p_a_t_h_v field. In oth- + er words, _g_l___p_a_t_h_v will point to _g_l___o_f_f_s NULL pointers, + followed by _g_l___p_a_t_h_c pathname pointers, followed by a + NULL pointer. + + GLOB_ERR Causes gglloobb() to return when it encounters a directory + that it cannot open or read. Ordinarily, gglloobb() contin- + ues to find matches. + + GLOB_MARK Each pathname that is a directory that matches _p_a_t_t_e_r_n + has a slash appended. + + GLOB_NOCHECK If _p_a_t_t_e_r_n does not match any pathname, then gglloobb() re- + turns a list consisting of only _p_a_t_t_e_r_n, with the number + of total pathnames is set to 1, and the number of + matched pathnames set to 0. If GLOB_QUOTE is set, its + effect is present in the pattern returned. + + GLOB_NOSORT By default, the pathnames are sorted in ascending ASCII + order; this flag prevents that sorting (speeding up + gglloobb()). + + The following values may also be included in _f_l_a_g_s, however, they are + non-standard extensions to IEEE Std1003.2 (``POSIX''). + + GLOB_ALTDIRFUNC The following additional fields in the pglob structure + have been initialized with alternate functions for glob + to use to open, read, and close directories and to get + stat information on names found in those directories. + + void *(*gl_opendir)(const char * name); + struct dirent *(*gl_readdir)(void *); + void (*gl_closedir)(void *); + int (*gl_lstat)(const char *name, struct stat *st); + int (*gl_stat)(const char *name, struct stat *st); + + This extension is provided to allow programs such as re- + store(8) to provide globbing from directories stored on + tape. + + GLOB_BRACE Pre-process the pattern string to expand `{pat,pat,...}' + strings like csh(1.)The pattern `{}' is left unexpanded + for historical reasons (Csh(1) does the same thing to + ease typing of find(1) patterns). + + GLOB_MAGCHAR Set by the gglloobb() function if the pattern included glob- + bing characters. See the description of the usage of + the _g_l___m_a_t_c_h_c structure member for more details. + + GLOB_NOMAGIC Is the same as GLOB_NOCHECK but it only appends the + _p_a_t_t_e_r_n if it does not contain any of the special char- + acters ``*'', ``?'' or ``[''. GLOB_NOMAGIC is provided + to simplify implementing the historic csh(1) globbing + behavior and should probably not be used anywhere else. + + GLOB_QUOTE Use the backslash (`\') character for quoting: every oc- + currence of a backslash followed by a character in the + pattern is replaced by that character, avoiding any spe- + cial interpretation of the character. + + GLOB_TILDE Expand patterns that start with `~' to user name home + directories. + + If, during the search, a directory is encountered that cannot be opened + or read and _e_r_r_f_u_n_c is non-NULL, gglloobb() calls _(_*_e_r_r_f_u_n_c_)_(_p_a_t_h_, _e_r_r_n_o_). + This may be unintuitive: a pattern like `*/Makefile' will try to stat(2) + `foo/Makefile' even if `foo' is not a directory, resulting in a call to + _e_r_r_f_u_n_c. The error routine can suppress this action by testing for ENOENT + and ENOTDIR; however, the GLOB_ERR flag will still cause an immediate re- + turn when this happens. + + If _e_r_r_f_u_n_c returns non-zero, gglloobb() stops the scan and returns GLOB_ABEND + after setting _g_l___p_a_t_h_c and _g_l___p_a_t_h_v to reflect any paths already matched. + This also happens if an error is encountered and GLOB_ERR is set in + _f_l_a_g_s, regardless of the return value of _e_r_r_f_u_n_c, if called. If GLOB_ERR + is not set and either _e_r_r_f_u_n_c is NULL or _e_r_r_f_u_n_c returns zero, the error + is ignored. + + The gglloobbffrreeee() function frees any space associated with _p_g_l_o_b from a pre- + vious call(s) to gglloobb(). + +RREETTUURRNN VVAALLUUEESS + On successful completion, gglloobb() returns zero. In addition the fields of + _p_g_l_o_b contain the values described below: + + _g_l___p_a_t_h_c contains the total number of matched pathnames so far. + This includes other matches from previous invocations of + gglloobb() if GLOB_APPEND was specified. + + _g_l___m_a_t_c_h_c contains the number of matched pathnames in the current in- + vocation of gglloobb(). + + _g_l___f_l_a_g_s contains a copy of the _f_l_a_g_s parameter with the bit + GLOB_MAGCHAR set if _p_a_t_t_e_r_n contained any of the special + characters ``*'', ``?'' or ``['', cleared if not. + + _g_l___p_a_t_h_v contains a pointer to a NULL-terminated list of matched + pathnames. However, if _g_l___p_a_t_h_c is zero, the contents of + _g_l___p_a_t_h_v are undefined. + + If gglloobb() terminates due to an error, it sets errno and returns one of + the following non-zero constants, which are defined in the include file + <_g_l_o_b_._h>: + + GLOB_NOSPACE An attempt to allocate memory failed. + + GLOB_ABEND The scan was stopped because an error was encountered and + either GLOB_ERR was set or _(_*_e_r_r_f_u_n_c_)_(_) returned non-zero. + + The arguments _p_g_l_o_b_-_>_g_l___p_a_t_h_c and _p_g_l_o_b_-_>_g_l___p_a_t_h_v are still set as speci- + fied above. + +SSEEEE AALLSSOO + sh(1), fnmatch(3), wordexp(3), regexp(3) + +SSTTAANNDDAARRDDSS + The gglloobb() function is expected to be IEEE Std1003.2 (``POSIX'') compati- + ble with the exception that the flags GLOB_ALTDIRFUNC, GLOB_BRACE + GLOB_MAGCHAR, GLOB_NOMAGIC, GLOB_QUOTE, and GLOB_TILDE, and the fields + _g_l___m_a_t_c_h_c and _g_l___f_l_a_g_s should not be used by applications striving for + strict POSIX conformance. + +EEXXAAMMPPLLEE + A rough equivalent of `ls -l *.c *.h' can be obtained with the following + code: + + GLOB_t g; + + g.gl_offs = 2; + glob("*.c", GLOB_DOOFFS, NULL, &g); + glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g); + g.gl_pathv[0] = "ls"; + g.gl_pathv[1] = "-l"; + execvp("ls", g.gl_pathv); + +HHIISSTTOORRYY + The gglloobb() and gglloobbffrreeee() functions first appeared in 4.4BSD. + +BBUUGGSS + Patterns longer than MAXPATHLEN may cause unchecked errors. + + The gglloobb() argument may fail and set errno for any of the errors speci- + fied for the library routines stat(2), closedir(3), opendir(3), + readdir(3), malloc(3), and free(3). + +4.4BSD June 9, 1993 4 diff --git a/usr/share/man/cat3/gmtime.0 b/usr/share/man/cat3/gmtime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/gmtime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/group_from_gid.0 b/usr/share/man/cat3/group_from_gid.0 new file mode 100644 index 0000000000..5cffb4cc0f --- /dev/null +++ b/usr/share/man/cat3/group_from_gid.0 @@ -0,0 +1,33 @@ +PWCACHE(3) BSD Programmer's Manual PWCACHE(3) + +NNAAMMEE + ppwwccaacchhee - cache password and group entries + +SSYYNNOOPPSSIISS + uusseerr__ffrroomm__uuiidd(_u_i_d___t _u_i_d, _i_n_t _n_o_u_s_e_r); + + ggrroouupp__ffrroomm__ggiidd(_g_i_d___t _g_i_d, _i_n_t _n_o_g_r_o_u_p); + +DDEESSCCRRIIPPTTIIOONN + The uusseerr__ffrroomm__uuiidd() function returns the user name associated with the + argument _u_i_d. The user name is cached so that multiple calls with the + same _u_i_d do not require additional calls to getpwuid(3). If there is no + user associated with the _u_i_d, a pointer is returned to a string represen- + tation of the _u_i_d, unless the argument _n_o_u_s_e_r is non-zero, in which case + a NULL pointer is returned. + + The ggrroouupp__ffrroomm__ggiidd() function returns the group name associated with the + argument _g_i_d. The group name is cached so that multiple calls with the + same _g_i_d do not require additional calls to getgrgid(3). If there is no + group associated with the _g_i_d, a pointer is returned to a string repre- + sentation of the _g_i_d, unless the argument _n_o_g_r_o_u_p is non-zero, in which + case a NULL pointer is returned. + +SSEEEE AALLSSOO + getgrgid(3), getpwuid(3) + +HHIISSTTOORRYY + The uusseerr__ffrroomm__iidd() and ggrroouupp__ffrroomm__iidd() functions first appeared in + 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/hash.0 b/usr/share/man/cat3/hash.0 new file mode 100644 index 0000000000..e3102e20e2 --- /dev/null +++ b/usr/share/man/cat3/hash.0 @@ -0,0 +1,132 @@ + + + +HASH(3) BSD Programmer's Manual HASH(3) + + +NNAAMMEE + hash - hash database access method + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + +DDEESSCCRRIIPPTTIIOONN + The routine _d_b_o_p_e_n 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 _d_b_o_p_e_n(3), this manual page describes only the hash + specific information. + + The hash data structure is an extensible, dynamic hashing + scheme. + + The access method specific data structure provided to + _d_b_o_p_e_n is defined in the include file as follows: + + typedef struct { + int bsize; + int ffactor; + int nelem; + int cachesize; + u_long (*hash)(const void *, size_t); + int lorder; + } HASHINFO; + + The elements of this structure are as follows: + + bsize _B_s_i_z_e 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. + + cachesize + A suggested maximum size, in bytes, of the memory + cache. This value is oonnllyy advisory, and the access + method will allocate more memory rather than fail. + + ffactor + _F_f_a_c_t_o_r 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. + + hash _H_a_s_h 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 + + + +4.4 Berkeley Distribution July 19, 1993 1 + + + + + + + + +HASH(3) BSD Programmer's Manual HASH(3) + + + function does poorly on a particular data set. + User specified hash functions must take two argu- + ments (a pointer to a byte string and a length) and + return an u_long to be used as the hash value. + + 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 _l_o_r_d_e_r 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. + + nelem _N_e_l_e_m 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. + + If the file already exists (and the O_TRUNC flag is not + specified), the values specified for the parameters bsize, + ffactor, lorder and nelem are ignored and the values spec- + ified when the tree was created are used. + + If a hash function is specified, _h_a_s_h___o_p_e_n 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. + + Backward compatible interfaces to the routines described + in _d_b_m(3), and _n_d_b_m(3) are provided, however, these inter- + faces are not compatible with previous file formats. + +SSEEEE AALLSSOO + _b_t_r_e_e(3), _d_b_o_p_e_n(3), _m_p_o_o_l(3), _r_e_c_n_o(3) + _D_y_n_a_m_i_c _H_a_s_h _T_a_b_l_e_s, Per-Ake Larson, Communications of the + ACM, April 1988. + _A _N_e_w _H_a_s_h _P_a_c_k_a_g_e _f_o_r _U_N_I_X, Margo Seltzer, USENIX Pro- + ceedings, Winter 1991. + +BBUUGGSS + Only big and little endian byte order is supported. + + + + + + + + + + + +4.4 Berkeley Distribution July 19, 1993 2 + + + + + diff --git a/usr/share/man/cat3/heapsort.0 b/usr/share/man/cat3/heapsort.0 new file mode 100644 index 0000000000..6e2ccc10fd --- /dev/null +++ b/usr/share/man/cat3/heapsort.0 @@ -0,0 +1,105 @@ +QSORT(3) BSD Programmer's Manual QSORT(3) + +NNAAMMEE + qqssoorrtt,, hheeaappssoorrtt,, mmeerrggeessoorrtt - sort functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + qqssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + hheeaappssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + mmeerrggeessoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + +DDEESSCCRRIIPPTTIIOONN + The qqssoorrtt() function is a modified partition-exchange sort, or quicksort. + The hheeaappssoorrtt() function is a modified selection sort. The mmeerrggeessoorrtt() + function is a modified merge sort with exponential search intended for + sorting data with pre-existing order. + + The qqssoorrtt() and hheeaappssoorrtt() functions sort an array of _n_m_e_m_b objects, the + initial member of which is pointed to by _b_a_s_e. The size of each object is + specified by _s_i_z_e. MMeerrggeessoorrtt() behaves similarly, but _r_e_q_u_i_r_e_s that _s_i_z_e + be greater than ``sizeof(void *) / 2''. + + The contents of the array _b_a_s_e are sorted in ascending order according to + a comparison function pointed to by _c_o_m_p_a_r, which requires two arguments + pointing to the objects being compared. + + 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. + + The functions qqssoorrtt() and hheeaappssoorrtt() are _n_o_t stable, that is, if two mem- + bers compare as equal, their order in the sorted array is undefined. The + function mmeerrggeessoorrtt() is stable. + + The qqssoorrtt() function is an implementation of C.A.R. Hoare's ``quicksort'' + algorithm, a variant of partition-exchange sorting; in particular, see + D.E. Knuth's Algorithm Q. QQssoorrtt() takes O N lg N average time. This im- + plementation uses median selection to avoid its O N**2 worst-case behav- + ior. + + The hheeaappssoorrtt() function is an implementation of J.W.J. William's ``heap- + sort'' algorithm, a variant of selection sorting; in particular, see D.E. + Knuth's Algorithm H. HHeeaappssoorrtt() takes O N lg N worst-case time. Its + _o_n_l_y advantage over qqssoorrtt() is that it uses almost no additional memory; + while qqssoorrtt() does not allocate memory, it is implemented using recur- + sion. + + The function mmeerrggeessoorrtt() requires additional memory of size _n_m_e_m_b _* _s_i_z_e + bytes; it should be used only when space is not at a premium. + MMeerrggeessoorrtt() is optimized for data with pre-existing order; its worst case + time is O N lg N; its best case is O N. + + Normally, qqssoorrtt() is faster than mmeerrggeessoorrtt() is faster than hheeaappssoorrtt(). + Memory availability and pre-existing order in the data can make this un- + true. + +RREETTUURRNN VVAALLUUEESS + The qqssoorrtt() function returns no value. + + Upon successful completion, hheeaappssoorrtt() and mmeerrggeessoorrtt() return 0. Other- + wise, they return -1 and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + The hheeaappssoorrtt() function succeeds unless: + + [EINVAL] The _s_i_z_e argument is zero, or, the _s_i_z_e argument to + mmeerrggeessoorrtt() is less than ``sizeof(void *) / 2''. + + [ENOMEM] HHeeaappssoorrtt() or mmeerrggeessoorrtt() were unable to allocate memory. + +CCOOMMPPAATTIIBBIILLIITTYY + Previous versions of qqssoorrtt() did not permit the comparison routine itself + to call qqssoorrtt(_3). This is no longer true. + +SSEEEE AALLSSOO + sort(1), radixsort(3) + + Hoare, C.A.R., "Quicksort", _T_h_e _C_o_m_p_u_t_e_r _J_o_u_r_n_a_l, 5:1, pp. 10-15, 1962. + + Williams, J.W.J, "Heapsort", _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, 7:1, pp. 347-348, + 1964. + + Knuth, D.E., "Sorting and Searching", _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g, + Vol. 3, pp. 114-123, 145-149, 1968. + + Mcilroy, P.M., "Optimistic Sorting and Information Theoretic Complexity", + _F_o_u_r_t_h _A_n_n_u_a_l _A_C_M_-_S_I_A_M _S_y_m_p_o_s_i_u_m _o_n _D_i_s_c_r_e_t_e _A_l_g_o_r_i_t_h_m_s, January 1992. + + Bentley, J.L., "Engineering a Sort Function", _b_e_n_t_l_e_y_@_r_e_s_e_a_r_c_h_._a_t_t_._c_o_m, + January 1992. + +SSTTAANNDDAARRDDSS + The qqssoorrtt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/herror.0 b/usr/share/man/cat3/herror.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/herror.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/htonl.0 b/usr/share/man/cat3/htonl.0 new file mode 100644 index 0000000000..a147b31181 --- /dev/null +++ b/usr/share/man/cat3/htonl.0 @@ -0,0 +1,40 @@ +BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) + +NNAAMMEE + hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte + order + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___l_o_n_g + hhttoonnll(_u___l_o_n_g _h_o_s_t_l_o_n_g); + + _u___s_h_o_r_t + hhttoonnss(_u___s_h_o_r_t _h_o_s_t_s_h_o_r_t); + + _u___l_o_n_g + nnttoohhll(_u___l_o_n_g _n_e_t_l_o_n_g); + + _u___s_h_o_r_t + nnttoohhss(_u___s_h_o_r_t _n_e_t_s_h_o_r_t); + +DDEESSCCRRIIPPTTIIOONN + These routines convert 16 and 32 bit quantities between network byte or- + der and host byte order. On machines which have a byte order which is + the same as the network order, routines are defined as null macros. + + These routines are most often used in conjunction with Internet addresses + and ports as returned by gethostbyname(3) and getservent(3). + +SSEEEE AALLSSOO + gethostbyname(3), getservent(3) + +HHIISSTTOORRYY + The bbyytteeoorrddeerr functions appeared in 4.2BSD. + +BBUUGGSS + On the VAX bytes are handled backwards from most everyone else in the + world. This is not expected to be fixed in the near future. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/htons.0 b/usr/share/man/cat3/htons.0 new file mode 100644 index 0000000000..a147b31181 --- /dev/null +++ b/usr/share/man/cat3/htons.0 @@ -0,0 +1,40 @@ +BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) + +NNAAMMEE + hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte + order + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___l_o_n_g + hhttoonnll(_u___l_o_n_g _h_o_s_t_l_o_n_g); + + _u___s_h_o_r_t + hhttoonnss(_u___s_h_o_r_t _h_o_s_t_s_h_o_r_t); + + _u___l_o_n_g + nnttoohhll(_u___l_o_n_g _n_e_t_l_o_n_g); + + _u___s_h_o_r_t + nnttoohhss(_u___s_h_o_r_t _n_e_t_s_h_o_r_t); + +DDEESSCCRRIIPPTTIIOONN + These routines convert 16 and 32 bit quantities between network byte or- + der and host byte order. On machines which have a byte order which is + the same as the network order, routines are defined as null macros. + + These routines are most often used in conjunction with Internet addresses + and ports as returned by gethostbyname(3) and getservent(3). + +SSEEEE AALLSSOO + gethostbyname(3), getservent(3) + +HHIISSTTOORRYY + The bbyytteeoorrddeerr functions appeared in 4.2BSD. + +BBUUGGSS + On the VAX bytes are handled backwards from most everyone else in the + world. This is not expected to be fixed in the near future. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/index.0 b/usr/share/man/cat3/index.0 new file mode 100644 index 0000000000..94eeae6ca1 --- /dev/null +++ b/usr/share/man/cat3/index.0 @@ -0,0 +1,27 @@ +INDEX(3) BSD Programmer's Manual INDEX(3) + +NNAAMMEE + iinnddeexx - locate character in string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + iinnddeexx(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iinnddeexx() function locates the first character matching _c (converted to + a _c_h_a_r) in the null-terminated string _s. + +RREETTUURRNN VVAALLUUEESS + A pointer to the character is returned if it is found; otherwise NULL is + returned. If _c is '\0', iinnddeexx() locates the terminating '\0'. + +SSEEEE AALLSSOO + memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +HHIISSTTOORRYY + A iinnddeexx() function appeared in Version 6 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/inet.0 b/usr/share/man/cat3/inet.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_addr.0 b/usr/share/man/cat3/inet_addr.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_addr.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_aton.0 b/usr/share/man/cat3/inet_aton.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_aton.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_lnaof.0 b/usr/share/man/cat3/inet_lnaof.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_lnaof.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_makeaddr.0 b/usr/share/man/cat3/inet_makeaddr.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_makeaddr.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_netof.0 b/usr/share/man/cat3/inet_netof.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_netof.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_network.0 b/usr/share/man/cat3/inet_network.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_network.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/inet_ntoa.0 b/usr/share/man/cat3/inet_ntoa.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/inet_ntoa.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/initgroups.0 b/usr/share/man/cat3/initgroups.0 new file mode 100644 index 0000000000..2386fe13fc --- /dev/null +++ b/usr/share/man/cat3/initgroups.0 @@ -0,0 +1,34 @@ +INITGROUPS(3) BSD Programmer's Manual INITGROUPS(3) + +NNAAMMEE + iinniittggrroouuppss - initialize group access list + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iinniittggrroouuppss(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _i_n_t _b_a_s_e_g_i_d); + +DDEESSCCRRIIPPTTIIOONN + The iinniittggrroouuppss() function uses the getgrouplist(3) function to calculate + the group access list for the user specified in _n_a_m_e. This group list is + then setup for the current process using setgroups(2). The _b_a_s_e_g_i_d is + automatically included in the groups list. Typically this value is given + as the group number from the password file. + +RREETTUURRNN VVAALLUUEESS + The iinniittggrroouuppss() function returns -1 if it was not invoked by the super- + user. + +SSEEEE AALLSSOO + setgroups(2), getgrouplist(3) + +HHIISSTTOORRYY + The iinniittggrroouuppss function appeared in 4.2BSD. + +BBUUGGSS + The ggeettggrroouupplliisstt() function called by iinniittggrroouuppss uses the routines based + on getgrent(3). If the invoking program uses any of these routines, the + group structure will be overwritten in the call to iinniittggrroouuppss(). + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/initstate.0 b/usr/share/man/cat3/initstate.0 new file mode 100644 index 0000000000..20b591fdd7 --- /dev/null +++ b/usr/share/man/cat3/initstate.0 @@ -0,0 +1,89 @@ +RANDOM(3) BSD Programmer's Manual RANDOM(3) + +NNAAMMEE + rraannddoomm, ssrraannddoomm, iinniittssttaattee, sseettssttaattee - better random number generator; + routines for changing generators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + rraannddoomm(_v_o_i_d); + + _v_o_i_d + ssrraannddoomm(_u_n_s_i_g_n_e_d _s_e_e_d); + + _c_h_a_r _* + iinniittssttaattee(_u_n_s_i_g_n_e_d _s_e_e_d, _c_h_a_r _*_s_t_a_t_e, _i_n_t _n); + + _c_h_a_r _* + sseettssttaattee(_c_h_a_r _*_s_t_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The rraannddoomm() function uses a non-linear 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 (2**31)-1. The + period of this random number generator is very large, approximately + 16*((2**31)-1). + + The rraannddoomm()/ ssrraannddoomm() have (almost) the same calling sequence and ini- + tialization properties as rand(3)/ srand(3). The difference is that + rand produces a much less random sequence -- in fact, the low dozen bits + generated by rand go through a cyclic pattern. All the bits generated by + rraannddoomm() are usable. For example, `random()&01' will produce a random + binary value. + + Unlike srand, ssrraannddoomm() does not return the old seed; the reason for + this is that the amount of state information used is much more than a + single word. (Two other routines are provided to deal with restart- + ing/changing random number generators). Like rand(3), however, rraannddoomm() + will by default produce a sequence of numbers that can be duplicated by + calling ssrraannddoomm() with `1' as the seed. + + The iinniittssttaattee() routine allows a state array, passed in as an argument, + to be initialized for future use. The size of the state array (in bytes) + is used by iinniittssttaattee() to decide how sophisticated a random number gener- + ator it should use -- the more state, the better the random numbers will + be. (Current "optimal" values for the amount of state information 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.) The + seed for the initialization (which specifies a starting point for the + random number sequence, and provides for restarting at the same point) is + also an argument. The iinniittssttaattee() function returns a pointer to the pre- + vious state information array. + + Once a state has been initialized, the sseettssttaattee() routine provides for + rapid switching between states. The sseettssttaattee() function returns a point- + er to the previous state array; its argument state array is used for fur- + ther random number generation until the next call to iinniittssttaattee() or + sseettssttaattee(). + + Once a state array has been initialized, it may be restarted at a differ- + ent point either by calling iinniittssttaattee() (with the desired seed, the state + array, and its size) or by calling both sseettssttaattee() (with the state array) + and ssrraannddoomm() (with the desired seed). The advantage of calling both + sseettssttaattee() and ssrraannddoomm() is that the size of the state array does not + have to be remembered after it is initialized. + + With 256 bytes of state information, the period of the random number gen- + erator is greater than 2**69 which should be sufficient for most purpos- + es. + +AAUUTTHHOORR + Earl T. Cohen + +DDIIAAGGNNOOSSTTIICCSS + If iinniittssttaattee() is called with less than 8 bytes of state information, or + if sseettssttaattee() detects that the state information has been garbled, error + messages are printed on the standard error output. + +SSEEEE AALLSSOO + rand(3) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + About 2/3 the speed of rand(3). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/innetgr.0 b/usr/share/man/cat3/innetgr.0 new file mode 100644 index 0000000000..1588f2b94f --- /dev/null +++ b/usr/share/man/cat3/innetgr.0 @@ -0,0 +1,64 @@ +GETNETGRENT(3) BSD Programmer's Manual GETNETGRENT(3) + +NNAAMMEE + ggeettnneettggrreenntt, iinnnneettggrr, sseettnneettggrreenntt, eennddnneettggrreenntt - netgroup database opera- + tions + +SSYYNNOOPPSSIISS + _i_n_t + ggeettnneettggrreenntt(_c_h_a_r _*_*_h_o_s_t_, _c_h_a_r _*_*_u_s_e_r_, _c_h_a_r _*_*_d_o_m_a_i_n); + + _i_n_t + iinnnneettggrr(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p_, _c_o_n_s_t _c_h_a_r _*_h_o_s_t_, _c_o_n_s_t _c_h_a_r _*_u_s_e_r_, ); + + _v_o_i_d + sseettnneettggrreenntt(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p); + + _v_o_i_d + eennddnneettggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the netgroup database file _/_e_t_c_/_n_e_t_g_r_o_u_p which + is described in netgroup(5). The database defines a set of netgroups, + each made up of one or more triples: + + (host, user, domain) + that defines a combination of host, user and domain. Any of the three + fields may be specified as ``wildcards'' that match any string. + + The function ggeettnneettggrreenntt() sets the three pointer arguments to the + strings of the next member of the current netgroup. If any of the string + pointers are ((cchhaarr **))00 that field is considered a wildcard. + + The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() set the current netgroup + and terminate the current netgroup respectively. If sseettnneettggrreenntt() is + called with a different netgroup than the previous call, an implicit + eennddnneettggrreenntt() is implied. SSeettnneettggrreenntt() also sets the offset to the + first member of the netgroup. + + The function iinnnneettggrr() searches for a match of all fields within the + specified group. If any of the hhoosstt, uusseerr, or ddoommaaiinn arguments are ((cchhaarr + **))00 those fields will match any string value in the netgroup member. + +RREETTUURRNN VVAALLUUEESS + The function ggeettnneettggrreenntt() returns 0 for ``no more netgroup members'' and + 1 otherwise. The function iinnnneettggrr() returns 1 for a successful match and + 0 otherwise. The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() have no re- + turn value. + +FFIILLEESS + /etc/netgroup netgroup database file + +SSEEEE AALLSSOO + nneettggrroouupp(_5) + +CCOOMMPPAATTIIBBIILLIITTYY + The netgroup members have three string fields to maintain compatibility + with other vendor implementations, however it is not obvious what use the + ddoommaaiinn string has within BSD. + +BBUUGGSS + The function ggeettnneettggrreenntt() returns pointers to dynamically allocated data + areas that are free'd when the function eennddnneettggrreenntt() is called. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isalnum.0 b/usr/share/man/cat3/isalnum.0 new file mode 100644 index 0000000000..9e9114120e --- /dev/null +++ b/usr/share/man/cat3/isalnum.0 @@ -0,0 +1,42 @@ +ISALNUM(3) BSD Programmer's Manual ISALNUM(3) + +NNAAMMEE + iissaallnnuumm - alphanumeric character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissaallnnuumm(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissaallnnuumm() function tests for any character for which isalpha(3) or + isdigit(3) is true. In the ASCII character set, this includes the fol- + lowing characters: + + + 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' + 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' + 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' + 106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J'' + 113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O'' + 120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T'' + 125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y'' + 132 ``Z'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' + 145 ``e'' 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' + 152 ``j'' 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' + 157 ``o'' 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' + 164 ``t'' 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' + 171 ``y'' 172 ``z'' + +RREETTUURRNN VVAALLUUEESS + The iissaallnnuumm() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissaallnnuumm() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isalpha.0 b/usr/share/man/cat3/isalpha.0 new file mode 100644 index 0000000000..df6b3bc575 --- /dev/null +++ b/usr/share/man/cat3/isalpha.0 @@ -0,0 +1,40 @@ +ISALPHA(3) BSD Programmer's Manual ISALPHA(3) + +NNAAMMEE + iissaallpphhaa - alphabetic character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissaallpphhaa(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissaallpphhaa() function tests for any character for which isupper(3) or + islower(3) is true. In the ASCII character set, this includes the fol- + lowing characters: + + + 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' + 106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J'' + 113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O'' + 120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T'' + 125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y'' + 132 ``Z'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' + 145 ``e'' 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' + 152 ``j'' 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' + 157 ``o'' 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' + 164 ``t'' 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' + 171 ``y'' 172 ``z'' + +RREETTUURRNN VVAALLUUEESS + The iissaallpphhaa() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissaallpphhaa() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isascii.0 b/usr/share/man/cat3/isascii.0 new file mode 100644 index 0000000000..f13b3d3b6a --- /dev/null +++ b/usr/share/man/cat3/isascii.0 @@ -0,0 +1,22 @@ +ISASCII(3) BSD Programmer's Manual ISASCII(3) + +NNAAMMEE + iissaasscciiii - test for ASCII character + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissaasscciiii(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissaasscciiii() function tests for an ASCII character, which is any charac- + ter with a value less than than or equal to 0177. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissaasscciiii() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isatty.0 b/usr/share/man/cat3/isatty.0 new file mode 100644 index 0000000000..ab04f37410 --- /dev/null +++ b/usr/share/man/cat3/isatty.0 @@ -0,0 +1,58 @@ +TTYNAME(3) BSD Programmer's Manual TTYNAME(3) + +NNAAMMEE + ttttyynnaammee, iissaattttyy, ttttyysslloott - get name of associated terminal (tty) from + file descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ttttyynnaammee(_i_n_t _f_d); + + _i_n_t + iissaattttyy(_i_n_t _f_d); + + _i_n_t + ttttyysslloott(); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the system file descriptors for terminal type + devices. These descriptors are not related to the standard I/O FILE type- + def, but refer to the special device files found in _/_d_e_v and named + _/_d_e_v_/_t_t_y_x_x and for which an entry exists in the initialization file + _/_e_t_c_/_t_t_y_s_. (See ttys(5).) + + The iissaattttyy() function determines if the file descriptor _f_d refers to a + valid terminal type device. + + The ttttyynnaammee() function gets the related device name of a file descriptor + for which iissaattttyy() is true + + The ttttyysslloott() function fetches the current process' control terminal num- + ber from the ttys(5) file entry. + +RREETTUURRNN VVAALLUUEESS + The ttttyynnaammee() function returns the null terminated name if the device is + found and iissaattttyy() is true; otherwise a NULL pointer is returned. + + The ttttyysslloott() function returns the unit number of the device file if + found; otherwise the value zero is returned. + +FFIILLEESS + /dev/* + /etc/ttys + +SSEEEE AALLSSOO + ioctl(2), ttys(5) + +HHIISSTTOORRYY + A iissaattttyy(), ttttyynnaammee(), and ttttyysslloott() function appeared in Version 7 AT&T + UNIX. + +BBUUGGSS + The ttttyynnaammee() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ttttyynnaammee() will mod- + ify the same object. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isblank.0 b/usr/share/man/cat3/isblank.0 new file mode 100644 index 0000000000..b3892bf5cc --- /dev/null +++ b/usr/share/man/cat3/isblank.0 @@ -0,0 +1,22 @@ +ISBLANK(3) BSD Programmer's Manual ISBLANK(3) + +NNAAMMEE + iissbbllaannkk - space or tab character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissbbllaannkk(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissbbllaannkk() function tests for a space or tab character. + +RREETTUURRNN VVAALLUUEESS + The iissbbllaannkk() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/iscntrl.0 b/usr/share/man/cat3/iscntrl.0 new file mode 100644 index 0000000000..ec52588588 --- /dev/null +++ b/usr/share/man/cat3/iscntrl.0 @@ -0,0 +1,35 @@ +ISCNTRL(3) BSD Programmer's Manual ISCNTRL(3) + +NNAAMMEE + iissccnnttrrll - control character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissccnnttrrll(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissccnnttrrll() function tests for any control character. In the ASCII + character set, this includes the following characters: + + + 000 nul 001 soh 002 stx 003 etx 004 eot + 005 enq 006 ack 007 bel 010 bs 011 ht + 012 nl 013 vt 014 np 015 cr 016 so + 017 si 020 dle 021 dc1 022 dc2 023 dc3 + 024 dc4 025 nak 026 syn 027 etb 030 can + 031 em 032 sub 033 esc 034 fs 035 gs + 036 rs 037 us 177 del + +RREETTUURRNN VVAALLUUEESS + The iissccnnttrrll() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissccnnttrrll() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isdigit.0 b/usr/share/man/cat3/isdigit.0 new file mode 100644 index 0000000000..1a8b470403 --- /dev/null +++ b/usr/share/man/cat3/isdigit.0 @@ -0,0 +1,30 @@ +ISDIGIT(3) BSD Programmer's Manual ISDIGIT(3) + +NNAAMMEE + iissddiiggiitt - decimal-digit character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissddiiggiitt(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissddiiggiitt() function tests for any decimal-digit character. In the + ASCII character set, this includes the following characters: + + + 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' + 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' + +RREETTUURRNN VVAALLUUEESS + The iissddiiggiitt() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissddiiggiitt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isgraph.0 b/usr/share/man/cat3/isgraph.0 new file mode 100644 index 0000000000..4039bc264e --- /dev/null +++ b/usr/share/man/cat3/isgraph.0 @@ -0,0 +1,47 @@ +ISGRAPH(3) BSD Programmer's Manual ISGRAPH(3) + +NNAAMMEE + iissggrraapphh - printing character test (space character exculsive) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissggrraapphh(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissggrraapphh() function tests for any printing character except space. In + the ASCII character set, this includes the following characters: + + + 041 ``!'' 042 ``"'' 043 ``#'' 044 ``$'' 045 ``%'' + 046 ``&'' 047 ``''' 050 ``('' 051 ``)'' 052 ``*'' + 053 ``+'' 054 ``,'' 055 ``-'' 056 ``.'' 057 ``/'' + 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' + 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' + 072 ``:'' 073 ``;'' 074 ``<'' 075 ``='' 076 ``>'' + 077 ``?'' 100 ``@'' 101 ``A'' 102 ``B'' 103 ``C'' + 104 ``D'' 105 ``E'' 106 ``F'' 107 ``G'' 110 ``H'' + 111 ``I'' 112 ``J'' 113 ``K'' 114 ``L'' 115 ``M'' + 116 ``N'' 117 ``O'' 120 ``P'' 121 ``Q'' 122 ``R'' + 123 ``S'' 124 ``T'' 125 ``U'' 126 ``V'' 127 ``W'' + 130 ``X'' 131 ``Y'' 132 ``Z'' 133 ``['' 134 ``'' + 135 ``]'' 136 ``^'' 137 ``_'' 140 ```'' 141 ``a'' + 142 ``b'' 143 ``c'' 144 ``d'' 145 ``e'' 146 ``f'' + 147 ``g'' 150 ``h'' 151 ``i'' 152 ``j'' 153 ``k'' + 154 ``l'' 155 ``m'' 156 ``n'' 157 ``o'' 160 ``p'' + 161 ``q'' 162 ``r'' 163 ``s'' 164 ``t'' 165 ``u'' + 166 ``v'' 167 ``w'' 170 ``x'' 171 ``y'' 172 ``z'' + 173 ``{'' 174 ``|'' 175 ``}'' 176 ``~'' + +RREETTUURRNN VVAALLUUEESS + The iissggrraapphh() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissggrraapphh() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isinf.0 b/usr/share/man/cat3/isinf.0 new file mode 100644 index 0000000000..d8a1086c1c --- /dev/null +++ b/usr/share/man/cat3/isinf.0 @@ -0,0 +1,29 @@ +ISINF(3) BSD Programmer's Manual ISINF(3) + +NNAAMMEE + iissiinnff, iissnnaann - test for infinity or not-a-number (_N_a_N) + +SSYYNNOOPPSSIISS + _i_n_t + iissiinnff(_d_o_u_b_l_e); + + _i_n_t + iissnnaann(_d_o_u_b_l_e); + +DDEESSCCRRIIPPTTIIOONN + The iissnniinnff() function returns 1 if the number is ``infinity'', otherwise + 0. + + The iissnnaann() function returns 1 if the number is ``_N_a_N'', otherwise 0. + +SSEEEE AALLSSOO + math(3) + + _I_E_E_E _S_t_a_n_d_a_r_d _f_o_r _B_i_n_a_r_y _F_l_o_a_t_i_n_g_-_P_o_i_n_t _A_r_i_t_h_m_e_t_i_c, Std 754-1985, ANSI. + +BBUUGGSS + Neither the VAX nor the Tahoe floating point have distinguished values + for either infinity or not-a-number. These routines always return 0 on + those architectures. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/islower.0 b/usr/share/man/cat3/islower.0 new file mode 100644 index 0000000000..ae6cc79293 --- /dev/null +++ b/usr/share/man/cat3/islower.0 @@ -0,0 +1,34 @@ +ISLOWER(3) BSD Programmer's Manual ISLOWER(3) + +NNAAMMEE + iisslloowweerr - lower-case character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iisslloowweerr(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iisslloowweerr() function tests for any lower-case letters. In the ASCII + character set, this includes the following characters: + + + 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' 145 ``e'' + 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' 152 ``j'' + 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' 157 ``o'' + 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' 164 ``t'' + 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' 171 ``y'' + 172 ``z'' + +RREETTUURRNN VVAALLUUEESS + The iisslloowweerr() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iisslloowweerr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isnan.0 b/usr/share/man/cat3/isnan.0 new file mode 100644 index 0000000000..d8a1086c1c --- /dev/null +++ b/usr/share/man/cat3/isnan.0 @@ -0,0 +1,29 @@ +ISINF(3) BSD Programmer's Manual ISINF(3) + +NNAAMMEE + iissiinnff, iissnnaann - test for infinity or not-a-number (_N_a_N) + +SSYYNNOOPPSSIISS + _i_n_t + iissiinnff(_d_o_u_b_l_e); + + _i_n_t + iissnnaann(_d_o_u_b_l_e); + +DDEESSCCRRIIPPTTIIOONN + The iissnniinnff() function returns 1 if the number is ``infinity'', otherwise + 0. + + The iissnnaann() function returns 1 if the number is ``_N_a_N'', otherwise 0. + +SSEEEE AALLSSOO + math(3) + + _I_E_E_E _S_t_a_n_d_a_r_d _f_o_r _B_i_n_a_r_y _F_l_o_a_t_i_n_g_-_P_o_i_n_t _A_r_i_t_h_m_e_t_i_c, Std 754-1985, ANSI. + +BBUUGGSS + Neither the VAX nor the Tahoe floating point have distinguished values + for either infinity or not-a-number. These routines always return 0 on + those architectures. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isprint.0 b/usr/share/man/cat3/isprint.0 new file mode 100644 index 0000000000..208f4a87c4 --- /dev/null +++ b/usr/share/man/cat3/isprint.0 @@ -0,0 +1,48 @@ +ISPRINT(3) BSD Programmer's Manual ISPRINT(3) + +NNAAMMEE + iisspprriinntt - printing character test (space character inclusive) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iisspprriinntt(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iisspprriinntt() function tests for any printing character including space + (' '). In the ASCII character set, this includes the following charac- + ters: + + + 040 sp 041 ``!'' 042 ``"'' 043 ``#'' 044 ``$'' + 045 ``%'' 046 ``&'' 047 ``''' 050 ``('' 051 ``)'' + 052 ``*'' 053 ``+'' 054 ``,'' 055 ``-'' 056 ``.'' + 057 ``/'' 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' + 064 ``4'' 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' + 071 ``9'' 072 ``:'' 073 ``;'' 074 ``<'' 075 ``='' + 076 ``>'' 077 ``?'' 100 ``@'' 101 ``A'' 102 ``B'' + 103 ``C'' 104 ``D'' 105 ``E'' 106 ``F'' 107 ``G'' + 110 ``H'' 111 ``I'' 112 ``J'' 113 ``K'' 114 ``L'' + 115 ``M'' 116 ``N'' 117 ``O'' 120 ``P'' 121 ``Q'' + 122 ``R'' 123 ``S'' 124 ``T'' 125 ``U'' 126 ``V'' + 127 ``W'' 130 ``X'' 131 ``Y'' 132 ``Z'' 133 ``['' + 134 ``'' 135 ``]'' 136 ``^'' 137 ``_'' 140 ```'' + 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' 145 ``e'' + 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i'' 152 ``j'' + 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n'' 157 ``o'' + 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s'' 164 ``t'' + 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x'' 171 ``y'' + 172 ``z'' 173 ``{'' 174 ``|'' 175 ``}'' 176 ``~'' + +RREETTUURRNN VVAALLUUEESS + The iisspprriinntt() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iisspprriinntt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ispunct.0 b/usr/share/man/cat3/ispunct.0 new file mode 100644 index 0000000000..009ebac804 --- /dev/null +++ b/usr/share/man/cat3/ispunct.0 @@ -0,0 +1,36 @@ +ISPUNCT(3) BSD Programmer's Manual ISPUNCT(3) + +NNAAMMEE + iissppuunncctt - punctuation character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissppuunncctt(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissppuunncctt() function tests for any printing character except for space + (' ') or a character for which isalnum(3) is true. In the ASCII charac- + ter set, this includes the following characters: + + + 041 ``!'' 042 ``"'' 043 ``#'' 044 ``$'' 045 ``%'' + 046 ``&'' 047 ``''' 050 ``('' 051 ``)'' 052 ``*'' + 053 ``+'' 054 ``,'' 055 ``-'' 056 ``.'' 057 ``/'' + 072 ``:'' 073 ``;'' 074 ``<'' 075 ``='' 076 ``>'' + 077 ``?'' 100 ``@'' 133 ``['' 134 ``'' 135 ``]'' + 136 ``^'' 137 ``_'' 140 ```'' 173 ``{'' 174 ``|'' + 175 ``}'' 176 ``~'' + +RREETTUURRNN VVAALLUUEESS + The iissppuunncctt() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissppuunncctt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isspace.0 b/usr/share/man/cat3/isspace.0 new file mode 100644 index 0000000000..54362c4cdb --- /dev/null +++ b/usr/share/man/cat3/isspace.0 @@ -0,0 +1,30 @@ +ISSPACE(3) BSD Programmer's Manual ISSPACE(3) + +NNAAMMEE + iissssppaaccee - white-space character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissssppaaccee(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissssppaaccee() function tests for the standard white-space characters. In + the ASCII character set, this includes the following characters: + + + 011 ht 012 nl 013 vt 014 np 015 cr + 040 sp + +RREETTUURRNN VVAALLUUEESS + The iissssppaaccee() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissssppaaccee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isupper.0 b/usr/share/man/cat3/isupper.0 new file mode 100644 index 0000000000..834103b906 --- /dev/null +++ b/usr/share/man/cat3/isupper.0 @@ -0,0 +1,34 @@ +ISUPPER(3) BSD Programmer's Manual ISUPPER(3) + +NNAAMMEE + iissuuppppeerr - upper-case character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissuuppppeerr(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissuuppppeerr() function tests for any upper-case letter. In the ASCII + character set, this includes the following characters: + + + 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' + 106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J'' + 113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O'' + 120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T'' + 125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y'' + 132 ``Z'' + +RREETTUURRNN VVAALLUUEESS + The iissuuppppeerr() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The isupper function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/isxdigit.0 b/usr/share/man/cat3/isxdigit.0 new file mode 100644 index 0000000000..9ef10a2ee2 --- /dev/null +++ b/usr/share/man/cat3/isxdigit.0 @@ -0,0 +1,33 @@ +ISXDIGIT(3) BSD Programmer's Manual ISXDIGIT(3) + +NNAAMMEE + iissxxddiiggiitt - hexadecimal-digit character test + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + iissxxddiiggiitt(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The iissxxddiiggiitt() function tests for any hexadecimal-digit character. In + the ASCII character set, this includes the following characters: + + + 060 ``0'' 061 ``1'' 062 ``2'' 063 ``3'' 064 ``4'' + 065 ``5'' 066 ``6'' 067 ``7'' 070 ``8'' 071 ``9'' + 101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E'' + 106 ``F'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d'' + 145 ``e'' 146 ``f'' + +RREETTUURRNN VVAALLUUEESS + The iissxxddiiggiitt() function returns zero if the character tests false and re- + turns non-zero if the character tests true. + +SSEEEE AALLSSOO + ctype(3), ascii(7) + +SSTTAANNDDAARRDDSS + The iissxxddiiggiitt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/labs.0 b/usr/share/man/cat3/labs.0 new file mode 100644 index 0000000000..f6759fefb3 --- /dev/null +++ b/usr/share/man/cat3/labs.0 @@ -0,0 +1,24 @@ +LABS(3) BSD Programmer's Manual LABS(3) + +NNAAMMEE + llaabbss - return the absolute value of a long integer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + llaabbss(_l_o_n_g _j); + +DDEESSCCRRIIPPTTIIOONN + The llaabbss() function returns the absolute value of the long integer _j. + +SSEEEE AALLSSOO + abs(3), floor(3), cabs(3), math(3) + +SSTTAANNDDAARRDDSS + The llaabbss() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + The absolute value of the most negative integer remains negative. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ldexp.0 b/usr/share/man/cat3/ldexp.0 new file mode 100644 index 0000000000..cad8742a73 --- /dev/null +++ b/usr/share/man/cat3/ldexp.0 @@ -0,0 +1,29 @@ +LDEXP(3) BSD Programmer's Manual LDEXP(3) + +NNAAMMEE + llddeexxpp - mutliply floating-point number by integral power of 2 + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + llddeexxpp(_d_o_u_b_l_e _x, _i_n_t _e_x_p); + +DDEESSCCRRIIPPTTIIOONN + The llddeexxpp() function multiplies a floating-point number by an integral + power of 2. + +RREETTUURRNN VVAALLUUEESS + The llddeexxpp() function returns the value of _x times 2 raised to the power + _e_x_p. + + If the resultant value would cause an overflow, the global variable _e_r_r_n_o + is set to ERANGE and the value HUGE is returned. + +SSEEEE AALLSSOO + frexp(3), modf(3), math(3) + +SSTTAANNDDAARRDDSS + The llddeexxpp() function conforms ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ldiv.0 b/usr/share/man/cat3/ldiv.0 new file mode 100644 index 0000000000..15f817d35f --- /dev/null +++ b/usr/share/man/cat3/ldiv.0 @@ -0,0 +1,23 @@ +LDIV(3) BSD Programmer's Manual LDIV(3) + +NNAAMMEE + llddiivv - return quotient and remainder from division + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_d_i_v___t + llddiivv(_i_n_t _n_u_m, _i_n_t _d_e_n_o_m); + +DDEESSCCRRIIPPTTIIOONN + The llddiivv() function computes the value _n_u_m_/_d_e_n_o_m and returns the quotient + and remainder in a structure named _l_d_i_v___t that contains two _l_o_n_g _i_n_t_e_g_e_r + members named _q_u_o_t and _r_e_m. + +SSEEEE AALLSSOO + div(3), math(3) + +SSTTAANNDDAARRDDSS + The llddiivv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/link_ntoa.0 b/usr/share/man/cat3/link_ntoa.0 new file mode 100644 index 0000000000..0f5be25efd --- /dev/null +++ b/usr/share/man/cat3/link_ntoa.0 @@ -0,0 +1,57 @@ +LINK_ADDR(3) BSD Programmer's Manual LINK_ADDR(3) + +NNAAMMEE + lliinnkk__aaddddrr, lliinnkk__nnttooaa - elementary address specification routines for link + level access + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + lliinnkk__aaddddrr(_c_o_n_s_t _c_h_a_r _*_a_d_d_r, _s_t_r_u_c_t _s_o_c_k_a_d_d_r___d_l _*_s_d_l); + + _c_h_a_r _* + lliinnkk__nnttooaa(_c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r___d_l _*_s_d_l); + +DDEESSCCRRIIPPTTIIOONN + The routine lliinnkk__aaddddrr() interprets character strings representing link- + level addresses, returning binary information suitable for use in system + calls. The routine lliinnkk__nnttooaa() takes a link-level address and returns an + ASCII string representing some of the information present, including the + link level address itself, and the interface name or number, if present. + This facility is experimental and is still subject to change. + + For lliinnkk__aaddddrr(), the string _a_d_d_r may contain an optional network inter- + face identifier of the form ``name unit-number'', suitable for the first + argument to ifconfig(4), followed in all cases by a colon and an inter- + face address in the form of groups of hexadecimal digits separated by pe- + riods. Each group represents a byte of address; address bytes are filled + left to right from low order bytes through high order bytes. + + Thus le0:8.0.9.13.d.30 represents an ethernet address to be transmitted + on the first Lance ethernet interface. + +RREETTUURRNN VVAALLUUEESS + lliinnkk__nnttooaa() always returns a null terminated string. lliinnkk__aaddddrr() has no + return value. (See _B_U_G_S.) + +SSEEEE AALLSSOO + iso(4), + +HHIISSTTOORRYY + The lliinnkk__aaddddrr() and lliinnkk__nnttooaa() functions appeared in 4.3BSD-Reno. + +BBUUGGSS + The returned values for link_ntoa reside in a static memory area. + + The function lliinnkk__aaddddrr() should diagnose improperly formed input, and + there should be an unambiguous way to recognize this. + + If the _s_d_l___l_e_n field of the link socket address _s_d_l is 0, lliinnkk__nnttooaa() + will not insert a colon before the interface address bytes. If this + translated address is given to lliinnkk__aaddddrr() without inserting an initial + colon, the latter will not interpret it correctly. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/localtime.0 b/usr/share/man/cat3/localtime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/localtime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/longjmp.0 b/usr/share/man/cat3/longjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/longjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/longjmperr.0 b/usr/share/man/cat3/longjmperr.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/longjmperr.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/longjmperror.0 b/usr/share/man/cat3/longjmperror.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/longjmperror.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/malloc.0 b/usr/share/man/cat3/malloc.0 new file mode 100644 index 0000000000..b2ca373cd8 --- /dev/null +++ b/usr/share/man/cat3/malloc.0 @@ -0,0 +1,40 @@ +MALLOC(3) BSD Programmer's Manual MALLOC(3) + +NNAAMMEE + mmaalllloocc, - general memory allocation function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmaalllloocc(_s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The mmaalllloocc() function allocates uninitialized space for an object whose + size is specified by _s_i_z_e. The mmaalllloocc() function maintains multiple lists + of free blocks according to size, allocating space from the appropriate + list. + + The allocated space is suitably aligned (after possible pointer coercion) + for storage of any type of object. If the space is of _p_a_g_e_s_i_z_e or larger, + the memory returned will be page-aligned. + +RREETTUURRNN VVAALLUUEESS + The mmaalllloocc() function returns a pointer to the allocated space if suc- + cessful; otherwise a null pointer is returned. + +SSEEEE AALLSSOO + brk(2), pagesize(2), free(3), calloc(3), alloca(3), realloc(3), + memory(3) + +SSTTAANNDDAARRDDSS + The mmaalllloocc() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + The current implementation of malloc does not always fail gracefully when + system memory limits are approached. It may fail to allocate memory when + larger free blocks could be broken up, or when limits are exceeded be- + cause the size is rounded up. It is optimized for sizes that are powers + of two. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/mbrune.0 b/usr/share/man/cat3/mbrune.0 new file mode 100644 index 0000000000..877f29a466 --- /dev/null +++ b/usr/share/man/cat3/mbrune.0 @@ -0,0 +1,52 @@ +MBRUNE(3) BSD Programmer's Manual MBRUNE(3) + +NNAAMMEE + mmbbrruunnee, mmbbrrrruunnee, mmbbmmbb - multibyte rune support for C + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + mmbbrruunnee(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g, _r_u_n_e___t _r_u_n_e); + + _c_h_a_r _* + mmbbrrrruunnee(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g, _r_u_n_e___t _r_u_n_e); + + _c_h_a_r _* + mmbbmmbb(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g, _c_h_a_r _*_p_a_t_t_e_r_n); + +DDEESSCCRRIIPPTTIIOONN + These routines provide the corresponding functionality of ssttrrcchhrr(), + ssttrrrrcchhrr() and ssttrrssttrr() for multibyte strings. + + The mmbbrruunnee() function locates the first occurence of rruunnee() in the string + pointed to by _s_t_r_i_n_g. The terminating NULL character is considered part + of the string. If _r_u_n_e is `\0', mmbbrruunnee() locates the terminating `\0'. + + The mmbbrrrruunnee() function locates the last occurrence of _r_u_n_e in the string + _s_t_r_i_n_g. If _r_u_n_e is `\0', mmbbrruunnee() locates the terminating `\0'. + + The mmbbmmbb() function locates the first occurence of the null-terminated + string _p_a_t_t_e_r_n in the null-terminated string _s_t_r_i_n_g_. If _p_a_t_t_e_r_n is the + empty string, mmbbmmbb() returns _s_t_r_i_n_g; if _p_a_t_t_e_r_n occurs nowhere in _s_t_r_i_n_g, + mmbbmmbb() returns NULL; otherwise mmbbmmbb() returns a pointer to the first + character of the first occurrence of _p_a_t_t_e_r_n. + +RREETTUURRNN VVAALLUUEESS + The function mmbbrruunnee() returns a pointer to the located character, or NULL + if the character does not appear in the string. + + The mmbbrrrruunnee() function returns a pointer to the character, or NULL if the + character does not appear in the string. + + The mmbbmmbb() function returns a pointer to the _p_a_t_t_e_r_n, or NULL if the + _p_a_t_t_e_r_n does not appear in the string. + +SSEEEE AALLSSOO + euc(4), mbrune(3), rune(3), setlocale(3), utf2(4) + +HHIISSTTOORRYY + The mmbbrruunnee(), mmbbrrrruunnee(), and mmbbmmbb() functions first appeared in Plan 9 + from Bell Labs as uuttffrruunnee(), uuttffrrrruunnee(), and uuttffuuttff(). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/memccpy.0 b/usr/share/man/cat3/memccpy.0 new file mode 100644 index 0000000000..ad82e2320f --- /dev/null +++ b/usr/share/man/cat3/memccpy.0 @@ -0,0 +1,25 @@ +MEMCCPY(3) BSD Programmer's Manual MEMCCPY(3) + +NNAAMMEE + mmeemmccccppyy - copy string until character found + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmeemmccccppyy(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _i_n_t _c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmccccppyy() function copies bytes from string _s_r_c to string _d_s_t. If the + character _c (as converted to an unsigned char) occurs in the string _s_r_c, + the copy stops and a pointer to the byte after the copy of _c in the + string _d_s_t is returned. Otherwise, _l_e_n bytes are copied, and a NULL + pointer is returned. + +SSEEEE AALLSSOO + bcopy(3), memcpy(3), memmove(3), strcpy(3) + +HHIISSTTOORRYY + The mmeemmccccppyy() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/memchr.0 b/usr/share/man/cat3/memchr.0 new file mode 100644 index 0000000000..f67ce8a932 --- /dev/null +++ b/usr/share/man/cat3/memchr.0 @@ -0,0 +1,27 @@ +MEMCHR(3) BSD Programmer's Manual MEMCHR(3) + +NNAAMMEE + mmeemmcchhrr - locate byte in byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmeemmcchhrr(_c_o_n_s_t _v_o_i_d _*_b, _i_n_t _c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmcchhrr() function locates the first occurrence of _c (converted to an + unsigned char) in string _b. + +RREETTUURRNN VVAALLUUEESS + The mmeemmcchhrr() function returns a pointer to the byte located, or NULL if + no such byte exists within _l_e_n bytes. + +SSEEEE AALLSSOO + index(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The mmeemmcchhrr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/memcmp.0 b/usr/share/man/cat3/memcmp.0 new file mode 100644 index 0000000000..b87a1bca62 --- /dev/null +++ b/usr/share/man/cat3/memcmp.0 @@ -0,0 +1,28 @@ +MEMCMP(3) BSD Programmer's Manual MEMCMP(3) + +NNAAMMEE + mmeemmccmmpp - compare byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + mmeemmccmmpp(_c_o_n_s_t _v_o_i_d _*_b_1, _c_o_n_s_t _v_o_i_d _*_b_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmccmmpp() function compares byte string _b_1 against byte string _b_2. + Both strings are assumed to be _l_e_n bytes long. + +RREETTUURRNN VVAALLUUEESS + The mmeemmccmmpp() function returns zero if the the two strings are identical, + otherwise returns the difference between the first two differing bytes + (treated as unsigned char values, so that `\200' is greater than `\0', + for example). Zero-length strings are always identical. + +SSEEEE AALLSSOO + bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3) + +SSTTAANNDDAARRDDSS + The mmeemmccmmpp() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/memcpy.0 b/usr/share/man/cat3/memcpy.0 new file mode 100644 index 0000000000..b7591d8412 --- /dev/null +++ b/usr/share/man/cat3/memcpy.0 @@ -0,0 +1,30 @@ +MEMCPY(3) BSD Programmer's Manual MEMCPY(3) + +NNAAMMEE + mmeemmccppyy - copy byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmeemmccppyy(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmccppyy() function copies _l_e_n bytes from string _s_r_c to string _d_s_t. + +RREETTUURRNN VVAALLUUEESS + The mmeemmccppyy() function returns the original value of _d_s_t. + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memmove(3), strcpy(3) + +SSTTAANNDDAARRDDSS + The mmeemmccppyy() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + In this implementation mmeemmccppyy() is implemented using bcopy(3), and + therefore the strings may overlap. On other systems, copying overlapping + strings may produce surprises. A simpler solution is to not use + mmeemmccppyy(). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/memmove.0 b/usr/share/man/cat3/memmove.0 new file mode 100644 index 0000000000..f5018e14ee --- /dev/null +++ b/usr/share/man/cat3/memmove.0 @@ -0,0 +1,26 @@ +MEMMOVE(3) BSD Programmer's Manual MEMMOVE(3) + +NNAAMMEE + mmeemmmmoovvee - copy byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmeemmmmoovvee(_v_o_i_d _*_d_s_t, _c_o_n_s_t _v_o_i_d _*_s_r_c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmmmoovvee() function copies _l_e_n bytes from string _s_r_c to string _d_s_t. + The two strings may overlap; the copy is always done in a non-destructive + manner. + +RREETTUURRNN VVAALLUUEESS + The mmeemmmmoovvee() function returns the original value of _d_s_t. + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memcpy(3), strcpy(3) + +SSTTAANNDDAARRDDSS + The mmeemmmmoovvee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/memory.0 b/usr/share/man/cat3/memory.0 new file mode 100644 index 0000000000..f28332dd67 --- /dev/null +++ b/usr/share/man/cat3/memory.0 @@ -0,0 +1,36 @@ +MEMORY(3) BSD Programmer's Manual MEMORY(3) + +NNAAMMEE + mmaalllloocc, ffrreeee, rreeaalllloocc, ccaalllloocc, aallllooccaa - general memory allocation opera- + tions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmaalllloocc(_s_i_z_e___t _s_i_z_e); + + _v_o_i_d + ffrreeee(_v_o_i_d _*_p_t_r); + + _v_o_i_d _* + rreeaalllloocc(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e); + + _v_o_i_d _* + ccaalllloocc(_s_i_z_e___t _n_e_l_e_m, _s_i_z_e___t _e_l_s_i_z_e); + + _v_o_i_d _* + aallllooccaa(_s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + These functions allocate and free memory for the calling process. They + are described in the individual manual pages. + +SSEEEE AALLSSOO + calloc(3), free(3), malloc(3), realloc(3), alloca(3), + +SSTTAANNDDAARRDDSS + These functions, with the exception of aallllooccaa() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/memset.0 b/usr/share/man/cat3/memset.0 new file mode 100644 index 0000000000..e74fc27fc1 --- /dev/null +++ b/usr/share/man/cat3/memset.0 @@ -0,0 +1,25 @@ +MEMSET(3) BSD Programmer's Manual MEMSET(3) + +NNAAMMEE + mmeemmsseett - write a byte to byte string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + mmeemmsseett(_v_o_i_d _*_b, _i_n_t _c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The mmeemmsseett() function writes _l_e_n bytes of value _c (converted to an un- + signed char) to the string _b. + +RREETTUURRNNSS + The mmeemmsseett() function returns its first argument. + +SSEEEE AALLSSOO + bzero(3), swab(3) + +SSTTAANNDDAARRDDSS + The mmeemmsseett() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/mergesort.0 b/usr/share/man/cat3/mergesort.0 new file mode 100644 index 0000000000..6e2ccc10fd --- /dev/null +++ b/usr/share/man/cat3/mergesort.0 @@ -0,0 +1,105 @@ +QSORT(3) BSD Programmer's Manual QSORT(3) + +NNAAMMEE + qqssoorrtt,, hheeaappssoorrtt,, mmeerrggeessoorrtt - sort functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + qqssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + hheeaappssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + mmeerrggeessoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + +DDEESSCCRRIIPPTTIIOONN + The qqssoorrtt() function is a modified partition-exchange sort, or quicksort. + The hheeaappssoorrtt() function is a modified selection sort. The mmeerrggeessoorrtt() + function is a modified merge sort with exponential search intended for + sorting data with pre-existing order. + + The qqssoorrtt() and hheeaappssoorrtt() functions sort an array of _n_m_e_m_b objects, the + initial member of which is pointed to by _b_a_s_e. The size of each object is + specified by _s_i_z_e. MMeerrggeessoorrtt() behaves similarly, but _r_e_q_u_i_r_e_s that _s_i_z_e + be greater than ``sizeof(void *) / 2''. + + The contents of the array _b_a_s_e are sorted in ascending order according to + a comparison function pointed to by _c_o_m_p_a_r, which requires two arguments + pointing to the objects being compared. + + 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. + + The functions qqssoorrtt() and hheeaappssoorrtt() are _n_o_t stable, that is, if two mem- + bers compare as equal, their order in the sorted array is undefined. The + function mmeerrggeessoorrtt() is stable. + + The qqssoorrtt() function is an implementation of C.A.R. Hoare's ``quicksort'' + algorithm, a variant of partition-exchange sorting; in particular, see + D.E. Knuth's Algorithm Q. QQssoorrtt() takes O N lg N average time. This im- + plementation uses median selection to avoid its O N**2 worst-case behav- + ior. + + The hheeaappssoorrtt() function is an implementation of J.W.J. William's ``heap- + sort'' algorithm, a variant of selection sorting; in particular, see D.E. + Knuth's Algorithm H. HHeeaappssoorrtt() takes O N lg N worst-case time. Its + _o_n_l_y advantage over qqssoorrtt() is that it uses almost no additional memory; + while qqssoorrtt() does not allocate memory, it is implemented using recur- + sion. + + The function mmeerrggeessoorrtt() requires additional memory of size _n_m_e_m_b _* _s_i_z_e + bytes; it should be used only when space is not at a premium. + MMeerrggeessoorrtt() is optimized for data with pre-existing order; its worst case + time is O N lg N; its best case is O N. + + Normally, qqssoorrtt() is faster than mmeerrggeessoorrtt() is faster than hheeaappssoorrtt(). + Memory availability and pre-existing order in the data can make this un- + true. + +RREETTUURRNN VVAALLUUEESS + The qqssoorrtt() function returns no value. + + Upon successful completion, hheeaappssoorrtt() and mmeerrggeessoorrtt() return 0. Other- + wise, they return -1 and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + The hheeaappssoorrtt() function succeeds unless: + + [EINVAL] The _s_i_z_e argument is zero, or, the _s_i_z_e argument to + mmeerrggeessoorrtt() is less than ``sizeof(void *) / 2''. + + [ENOMEM] HHeeaappssoorrtt() or mmeerrggeessoorrtt() were unable to allocate memory. + +CCOOMMPPAATTIIBBIILLIITTYY + Previous versions of qqssoorrtt() did not permit the comparison routine itself + to call qqssoorrtt(_3). This is no longer true. + +SSEEEE AALLSSOO + sort(1), radixsort(3) + + Hoare, C.A.R., "Quicksort", _T_h_e _C_o_m_p_u_t_e_r _J_o_u_r_n_a_l, 5:1, pp. 10-15, 1962. + + Williams, J.W.J, "Heapsort", _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, 7:1, pp. 347-348, + 1964. + + Knuth, D.E., "Sorting and Searching", _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g, + Vol. 3, pp. 114-123, 145-149, 1968. + + Mcilroy, P.M., "Optimistic Sorting and Information Theoretic Complexity", + _F_o_u_r_t_h _A_n_n_u_a_l _A_C_M_-_S_I_A_M _S_y_m_p_o_s_i_u_m _o_n _D_i_s_c_r_e_t_e _A_l_g_o_r_i_t_h_m_s, January 1992. + + Bentley, J.L., "Engineering a Sort Function", _b_e_n_t_l_e_y_@_r_e_s_e_a_r_c_h_._a_t_t_._c_o_m, + January 1992. + +SSTTAANNDDAARRDDSS + The qqssoorrtt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/mkstemp.0 b/usr/share/man/cat3/mkstemp.0 new file mode 100644 index 0000000000..ac6de6ed5a --- /dev/null +++ b/usr/share/man/cat3/mkstemp.0 @@ -0,0 +1,55 @@ +MKTEMP(3) BSD Programmer's Manual MKTEMP(3) + +NNAAMMEE + mmkktteemmpp - make temporary file name (unique) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + mmkktteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e); + + _i_n_t + mmkksstteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The mmkktteemmpp() function takes the given file name template and overwrites a + portion of it to create a file name. This file name is unique and suit- + able for use by the application. The template may be any file name with + some number of `Xs' appended to it, for example _/_t_m_p_/_t_e_m_p_._X_X_X_X. The + trailing `Xs' are replaced with the current process number and/or a + unique letter combination. The number of unique file names mmkktteemmpp() can + return depends on the number of `Xs' provided; six `Xs' will result in + mmkktteemmpp() testing roughly 26 ** 6 combinations. + + The mmkksstteemmpp() function makes the same replacement to the template and + creates the template file, mode 0600, returning a file descriptor opened + for reading and writing. This avoids the race between testing for a + file's existence and opening it for use. + +RREETTUURRNN VVAALLUUEESS + The mmkktteemmpp() function returns a pointer to the template on success and + NULL on failure. The mmkksstteemmpp() function returns -1 if no suitable file + could be created. If either call fails an error code is placed in the + global variable _e_r_r_n_o. + +EERRRROORRSS + The mmkktteemmpp() and mmkksstteemmpp() functions may set _e_r_r_n_o to one of the follow- + ing values: + + [ENOTDIR] The pathname portion of the template is not an existing direc- + tory. + + The mmkktteemmpp() and mmkksstteemmpp() functions may also set _e_r_r_n_o to any value + specified by the stat(2) function. + + The mmkksstteemmpp() function may also set _e_r_r_n_o to any value specified by the + open(2) function. + +SSEEEE AALLSSOO + chmod(2), getpid(2), open(2), stat(2) + +HHIISSTTOORRYY + A mmkktteemmpp function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/mktemp.0 b/usr/share/man/cat3/mktemp.0 new file mode 100644 index 0000000000..ac6de6ed5a --- /dev/null +++ b/usr/share/man/cat3/mktemp.0 @@ -0,0 +1,55 @@ +MKTEMP(3) BSD Programmer's Manual MKTEMP(3) + +NNAAMMEE + mmkktteemmpp - make temporary file name (unique) + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + mmkktteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e); + + _i_n_t + mmkksstteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The mmkktteemmpp() function takes the given file name template and overwrites a + portion of it to create a file name. This file name is unique and suit- + able for use by the application. The template may be any file name with + some number of `Xs' appended to it, for example _/_t_m_p_/_t_e_m_p_._X_X_X_X. The + trailing `Xs' are replaced with the current process number and/or a + unique letter combination. The number of unique file names mmkktteemmpp() can + return depends on the number of `Xs' provided; six `Xs' will result in + mmkktteemmpp() testing roughly 26 ** 6 combinations. + + The mmkksstteemmpp() function makes the same replacement to the template and + creates the template file, mode 0600, returning a file descriptor opened + for reading and writing. This avoids the race between testing for a + file's existence and opening it for use. + +RREETTUURRNN VVAALLUUEESS + The mmkktteemmpp() function returns a pointer to the template on success and + NULL on failure. The mmkksstteemmpp() function returns -1 if no suitable file + could be created. If either call fails an error code is placed in the + global variable _e_r_r_n_o. + +EERRRROORRSS + The mmkktteemmpp() and mmkksstteemmpp() functions may set _e_r_r_n_o to one of the follow- + ing values: + + [ENOTDIR] The pathname portion of the template is not an existing direc- + tory. + + The mmkktteemmpp() and mmkksstteemmpp() functions may also set _e_r_r_n_o to any value + specified by the stat(2) function. + + The mmkksstteemmpp() function may also set _e_r_r_n_o to any value specified by the + open(2) function. + +SSEEEE AALLSSOO + chmod(2), getpid(2), open(2), stat(2) + +HHIISSTTOORRYY + A mmkktteemmpp function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/mktime.0 b/usr/share/man/cat3/mktime.0 new file mode 100644 index 0000000000..cb0fe128fc --- /dev/null +++ b/usr/share/man/cat3/mktime.0 @@ -0,0 +1,131 @@ +CTIME(3) BSD Programmer's Manual CTIME(3) + +NNAAMMEE + aassccttiimmee, ccttiimmee, ddiiffffttiimmee, ggmmttiimmee, llooccaallttiimmee, mmkkttiimmee - transform binary + date and time value to ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _e_x_t_e_r_n _c_h_a_r _*_t_z_n_a_m_e_[_2_]_; + + _c_h_a_r _* + ccttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _d_o_u_b_l_e + ddiiffffttiimmee(_t_i_m_e___t _t_i_m_e_1, _t_i_m_e___t _t_i_m_e_0); + + _c_h_a_r _* + aassccttiimmee(_c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_m); + + _s_t_r_u_c_t _t_m _* + llooccaallttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _s_t_r_u_c_t _t_m _* + ggmmttiimmee(_c_o_n_s_t _t_i_m_e___t _*_c_l_o_c_k); + + _t_i_m_e___t + mmkkttiimmee(_s_t_r_u_c_t _t_m _*_t_m); + +DDEESSCCRRIIPPTTIIOONN + The functions ccttiimmee(), ggmmttiimmee() and llooccaallttiimmee() all take as an argument a + time value representing the time in seconds since the Epoch (00:00:00 + UTC, January 1, 1970; see time(3)). + + The function llooccaallttiimmee() converts the time value pointed at by _c_l_o_c_k, and + returns a pointer to a ``_s_t_r_u_c_t _t_m'' (described below) which contains the + broken-out time information for the value after adjusting for the current + time zone (and any other factors such as Daylight Saving Time). Time + zone adjustments are performed as specified by the TZ environmental vari- + able (see tzset(3)). The function llooccaallttiimmee() uses tzset to initialize + time conversion information if tzset has not already been called by the + process. + + After filling in the tm structure, llooccaallttiimmee() sets the _t_m___i_s_d_s_t'th ele- + ment of _t_z_n_a_m_e to a pointer to an ASCII string that's the time zone ab- + breviation to be used with llooccaallttiimmee()'s return value. + + The function ggmmttiimmee() similarly converts the time value, but without any + time zone adjustment, and returns a pointer to a tm structure (described + below). + + The ccttiimmee() function adjusts the time value for the current time zone in + the same manner as llooccaallttiimmee(), and returns a pointer to a 26-character + string of the form: + + Thu Nov 24 18:22:48 1986\n\0 + + All the fields have constant width. + + The aassccttiimmee() function converts the broken down time in the structure _t_m + pointed at by _*_t_m to the form shown in the example above. + + The function mmkkttiimmee() converts the broken-down time, expressed as local + time, in the structure pointed to by tm into a time value with the same + encoding as that of the values returned by the time(3) function, that is, + seconds from the Epoch, UTC. + + The original values of the _t_m___w_d_a_y and _t_m___y_d_a_y components of the struc- + ture are ignored, and the original values of the other components are not + restricted to their normal ranges. (A positive or zero value for + _t_m___i_s_d_s_t causes mmkkttiimmee() to presume initially that summer time (for exam- + ple, Daylight Saving Time) is or is not in effect for the specified time, + respectively. A negative value for _t_m___i_s_d_s_t causes the mmkkttiimmee() function + to attempt to divine whether summer time is in effect for the specified + time.) + + On successful completion, the values of the _t_m___w_d_a_y and _t_m___y_d_a_y compo- + nents of the structure are set appropriately, and the other components + are set to represent the specified calendar time, but with their values + forced to their normal ranges; the final value of _t_m___m_d_a_y is not set un- + til _t_m___m_o_n and _t_m___y_e_a_r are determined. MMkkttiimmee() returns the specified + calendar time; if the calendar time cannot be represented, it returns -1; + + The ddiiffffttiimmee() function returns the difference between two calendar + times, (_t_i_m_e_1 - _t_i_m_e_0), expressed in seconds. + + External declarations as well as the tm structure definition are in the + <_t_i_m_e_._h> include file. The tm structure includes at least the following + fields: + + int tm_sec; /* seconds (0 - 60) */ + int tm_min; /* minutes (0 - 59) */ + int tm_hour; /* hours (0 - 23) */ + int tm_mday; /* day of month (1 - 31) */ + int tm_mon; /* month of year (0 - 11) */ + int tm_year; /* year - 1900 */ + int tm_wday; /* day of week (Sunday = 0) */ + int tm_yday; /* day of year (0 - 365) */ + int tm_isdst; /* is summer time in effect? */ + char *tm_zone; /* abbreviation of timezone name */ + long tm_gmtoff; /* offset from UTC in seconds */ + + The field _t_m___i_s_d_s_t is non-zero if summer time is in effect. + + The field _t_m___g_m_t_o_f_f is the offset (in seconds) of the time represented + from UTC, with positive values indicating east of the Prime Meridian. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), getenv(3), time(3), tzset(3), tzfile(5) + +HHIISSTTOORRYY + This manual page is derived from the time package contributed to Berkeley + by Arthur Olsen and which appeared in 4.3BSD. + +BBUUGGSS + Except for ddiiffffttiimmee() and mmkkttiimmee(), these functions leaves their result + in an internal static object and return a pointer to that object. Subse- + quent calls to these function will modify the same object. + + The _t_m___z_o_n_e field of a returned tm structure points to a static array of + characters, which will also be overwritten by any subsequent calls (as + well as by subsequent calls to tzset(3) and tzsetwall(3)). + + Use of the external variable _t_z_n_a_m_e is discouraged; the _t_m___z_o_n_e entry in + the tm structure is preferred. + + Avoid using out-of-range values with mmkkttiimmee() when setting up lunch with + promptness sticklers in Riyadh. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/modf.0 b/usr/share/man/cat3/modf.0 new file mode 100644 index 0000000000..611e09e65d --- /dev/null +++ b/usr/share/man/cat3/modf.0 @@ -0,0 +1,27 @@ +MODF(3) BSD Programmer's Manual MODF(3) + +NNAAMMEE + mmooddff - extract signed integral and fractional values from floating-point + number + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + mmooddff(_d_o_u_b_l_e _v_a_l_u_e, _d_o_u_b_l_e _*_i_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The mmooddff() function breaks the argument _v_a_l_u_e into integral and fraction- + al parts, each of which has the same sign as the argument. It stores the + integral part as a _d_o_u_b_l_e in the object pointed to by _i_p_t_r. + +RREETTUURRNN VVAALLUUEESS + The mmooddff() function returns the signed fractional part of _v_a_l_u_e. + +SSEEEE AALLSSOO + frexp(3), ldexp(3), math(3) + +SSTTAANNDDAARRDDSS + The mmooddff() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/moncontrol.0 b/usr/share/man/cat3/moncontrol.0 new file mode 100644 index 0000000000..9c152c4076 --- /dev/null +++ b/usr/share/man/cat3/moncontrol.0 @@ -0,0 +1,41 @@ +MONCONTROL(3) BSD Programmer's Manual MONCONTROL(3) + +NNAAMMEE + mmoonnccoonnttrrooll, mmoonnssttaarrttuupp - control execution profile + +SSYYNNOOPPSSIISS + mmoonnccoonnttrrooll(_i_n_t _m_o_d_e); + + mmoonnssttaarrttuupp(_u___l_o_n_g _*_l_o_w_p_c, _u___l_o_n_g _*_h_i_g_h_p_c); + +DDEESSCCRRIIPPTTIIOONN + An executable program compiled using the --ppgg option to cc(1) automatical- + ly includes calls to collect statistics for the gprof(1) call-graph exe- + cution profiler. In typical operation, profiling begins at program + startup and ends when the program calls exit. When the program exits, + the profiling data are written to the file _g_m_o_n_._o_u_t, then gprof(1) can be + used to examine the results. + + mmoonnccoonnttrrooll() selectively controls profiling within a program. When the + program starts, profiling begins. To stop the collection of histogram + ticks and call counts use mmoonnccoonnttrrooll(_0); to resume the collection of his- + togram ticks and call counts use mmoonnccoonnttrrooll(_1). This feature allows the + cost of particular operations to be measured. Note that an output file + will be produced on program exit regardless of the state of mmoonnccoonnttrrooll(). + + Programs that are not loaded with --ppgg may selectively collect profiling + statistics by calling mmoonnssttaarrttuupp() with the range of addresses to be pro- + filed. _l_o_w_p_c and _h_i_g_h_p_c specify the address range that is to be sampled; + the lowest address sampled is that of _l_o_w_p_c and the highest is just below + _h_i_g_h_p_c. Only functions in that range that have been compiled with the --ppgg + option to cc(1) will appear in the call graph part of the output; howev- + er, all functions in that address range will have their execution time + measured. Profiling begins on return from mmoonnssttaarrttuupp(). + +FFIILLEESS + gmon.out execution data file + +SSEEEE AALLSSOO + cc(1), gprof(1), profil(2) + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/monstartup.0 b/usr/share/man/cat3/monstartup.0 new file mode 100644 index 0000000000..9c152c4076 --- /dev/null +++ b/usr/share/man/cat3/monstartup.0 @@ -0,0 +1,41 @@ +MONCONTROL(3) BSD Programmer's Manual MONCONTROL(3) + +NNAAMMEE + mmoonnccoonnttrrooll, mmoonnssttaarrttuupp - control execution profile + +SSYYNNOOPPSSIISS + mmoonnccoonnttrrooll(_i_n_t _m_o_d_e); + + mmoonnssttaarrttuupp(_u___l_o_n_g _*_l_o_w_p_c, _u___l_o_n_g _*_h_i_g_h_p_c); + +DDEESSCCRRIIPPTTIIOONN + An executable program compiled using the --ppgg option to cc(1) automatical- + ly includes calls to collect statistics for the gprof(1) call-graph exe- + cution profiler. In typical operation, profiling begins at program + startup and ends when the program calls exit. When the program exits, + the profiling data are written to the file _g_m_o_n_._o_u_t, then gprof(1) can be + used to examine the results. + + mmoonnccoonnttrrooll() selectively controls profiling within a program. When the + program starts, profiling begins. To stop the collection of histogram + ticks and call counts use mmoonnccoonnttrrooll(_0); to resume the collection of his- + togram ticks and call counts use mmoonnccoonnttrrooll(_1). This feature allows the + cost of particular operations to be measured. Note that an output file + will be produced on program exit regardless of the state of mmoonnccoonnttrrooll(). + + Programs that are not loaded with --ppgg may selectively collect profiling + statistics by calling mmoonnssttaarrttuupp() with the range of addresses to be pro- + filed. _l_o_w_p_c and _h_i_g_h_p_c specify the address range that is to be sampled; + the lowest address sampled is that of _l_o_w_p_c and the highest is just below + _h_i_g_h_p_c. Only functions in that range that have been compiled with the --ppgg + option to cc(1) will appear in the call graph part of the output; howev- + er, all functions in that address range will have their execution time + measured. Profiling begins on return from mmoonnssttaarrttuupp(). + +FFIILLEESS + gmon.out execution data file + +SSEEEE AALLSSOO + cc(1), gprof(1), profil(2) + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/multibyte.0 b/usr/share/man/cat3/multibyte.0 new file mode 100644 index 0000000000..8b82fdbbbd --- /dev/null +++ b/usr/share/man/cat3/multibyte.0 @@ -0,0 +1,108 @@ +MULTIBYTE(3) BSD Programmer's Manual MULTIBYTE(3) + +NNAAMMEE + mmbblleenn, mmbbssttoowwccss, mmbbttoowwcc, wwccssttoommbbss, wwccttoommbb - multibyte character support + for C + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + mmbblleenn(_c_o_n_s_t _c_h_a_r _*_m_b_c_h_a_r, _i_n_t _n_b_y_t_e_s); + + _s_i_z_e___t + mmbbssttoowwccss(_w_c_h_a_r___t _*_w_c_s_t_r_i_n_g, _c_o_n_s_t _c_h_a_r _*_m_b_s_t_r_i_n_g, _s_i_z_e___t _n_w_c_h_a_r_s); + + _i_n_t + mmbbttoowwcc(_w_c_h_a_r___t _*_w_c_h_a_r_p, _c_o_n_s_t _c_h_a_r _*_m_b_c_h_a_r, _s_i_z_e___t _n_b_y_t_e_s); + + _s_i_z_e___t + wwccssttoommbbss(_c_h_a_r _*_m_b_s_t_r_i_n_g, _c_o_n_s_t _w_c_h_a_r___t _*_w_c_s_t_r_i_n_g, _s_i_z_e___t _n_b_y_t_e_s); + + _i_n_t + wwccttoommbb(_c_h_a_r _*_m_b_c_h_a_r, _w_c_h_a_r___t _w_c_h_a_r); + +DDEESSCCRRIIPPTTIIOONN + The basic elements of some written natural languages such as Chinese can- + not be represented uniquely with single C _c_h_a_rs. The C standard supports + two different ways of dealing with extended natural language encodings, + _w_i_d_e characters and _m_u_l_t_i_b_y_t_e characters. Wide characters are an inter- + nal representation which allows each basic element to map to a single ob- + ject of type _w_c_h_a_r___t. Multibyte characters are used for input and output + and code each basic element as a sequence of C _c_h_a_rs. Individual basic + elements may map into one or more (up to MB_CHAR_MAX) bytes in a multi- + byte character. + + The current locale (setlocale(3)) governs the interpretation of wide and + multibyte characters. The locale category LC_CTYPE specifically controls + this interpretation. The _w_c_h_a_r___t type is wide enough to hold the largest + value in the wide character representations for all locales. + + Multibyte strings may contain `shift' indicators to switch to and from + particular modes within the given representation. If explicit bytes are + used to signal shifting, these are not recognized as separate characters + but are lumped with a neighboring character. There is always a distin- + guished `initial' shift state. The mmbbssttoowwccss() and wwccssttoommbbss() functions + assume that multibyte strings are interpreted starting from the initial + shift state. The mmbblleenn(), mmbbttoowwcc() and wwccttoommbb() functions maintain stat- + ic shift state internally. A call with a null _m_b_c_h_a_r pointer returns + nonzero if the current locale requires shift states, zero otherwise; if + shift states are required, the shift state is reset to the initial state. + The internal shift states are undefined after a call to sseettllooccaallee() with + the LC_CTYPE or LC_ALL categories. + + For convenience in processing, the wide character with value 0 (the null + wide character) is recognized as the wide character string terminator, + and the character with value 0 (the null byte) is recognized as the + multibyte character string terminator. Null bytes are not permitted + within multibyte characters. + + The mmbblleenn() function computes the length in bytes of a multibyte charac- + ter _m_b_c_h_a_r. Up to _n_b_y_t_e_s bytes are examined. + + The mmbbttoowwcc() function converts a multibyte character _m_b_c_h_a_r into a wide + character and stores the result in the object pointed to by _w_c_h_a_r_p_. Up to + _n_b_y_t_e_s bytes are examined. + + The wwccttoommbb() function converts a wide character _w_c_h_a_r into a multibyte + character and stores the result in _m_b_c_h_a_r. The object pointed to by + _m_b_c_h_a_r must be large enough to accommodate the multibyte character. + + The mmbbssttoowwccss() function converts a multibyte character string _m_b_s_t_r_i_n_g + into a wide character string _w_c_s_t_r_i_n_g. No more than _n_w_c_h_a_r_s wide charac- + ters are stored. A terminating null wide character is appended if there + is room. + + The wwccssttoommbbss() function converts a wide character string _w_c_s_t_r_i_n_g into a + multibyte character string _m_b_s_t_r_i_n_g. Up to _n_b_y_t_e_s bytes are stored in + _m_b_s_t_r_i_n_g. Partial multibyte characters at the end of the string are not + stored. The multibyte character string is null terminated if there is + room. + +RREETTUURRNN VVAALLUUEESS + If multibyte characters are not supported in the current locale, all of + these functions will return -1 if characters can be processed, otherwise + 0. + + If _m_b_c_h_a_r is NULL, the mmbblleenn(), mmbbttoowwcc() and wwccttoommbb() functions return + nonzero if shift states are supported, zero otherwise. If _m_b_c_h_a_r is + valid, then these functions return the number of bytes processed in + _m_b_c_h_a_r, or -1 if no multibyte character could be recognized or converted. + + The mmbbssttoowwccss() function returns the number of wide characters converted, + not counting any terminating null wide character. The wwccssttoommbbss() func- + tion returns the number of bytes converted, not counting any terminating + null byte. If any invalid multibyte characters are encountered, both + functions return -1. + +SSEEEE AALLSSOO + euc(4), mbrune(3), rune(3), setlocale(3), utf2(4) + +SSTTAANNDDAARRDDSS + The mmbblleenn(), mmbbssttoowwccss(), mmbbttoowwcc(), wwccssttoommbbss() and wwccttoommbb() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + The current implementation does not support shift states. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/network.0 b/usr/share/man/cat3/network.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/network.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/nice.0 b/usr/share/man/cat3/nice.0 new file mode 100644 index 0000000000..bf9f513345 --- /dev/null +++ b/usr/share/man/cat3/nice.0 @@ -0,0 +1,26 @@ +NICE(3) BSD Programmer's Manual NICE(3) + +NNAAMMEE + nniiccee - set program scheduling priority + +SSYYNNOOPPSSIISS + nniiccee(_i_n_t _i_n_c_r); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy sseettpprriioorriittyy((22)).. + + The nniiccee() function obtains the scheduling priority of the process from + the system and sets it to the priority value specified in _i_n_c_r. The pri- + ority is a value in the range -20 to 20. The default priority is 0; low- + er priorities cause more favorable scheduling. Only the super-user may + lower priorities. + + Children inherit the priority of their parent processes via fork(2). + +SSEEEE AALLSSOO + nice(1), setpriority(2), fork(2), renice(8) + +HHIISSTTOORRYY + A nniiccee() syscall appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/nlist.0 b/usr/share/man/cat3/nlist.0 new file mode 100644 index 0000000000..8310c58ad3 --- /dev/null +++ b/usr/share/man/cat3/nlist.0 @@ -0,0 +1,31 @@ +NLIST(3) BSD Programmer's Manual NLIST(3) + +NNAAMMEE + nnlliisstt - retrieve symbol table name list from an executable file + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + nnlliisstt(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e, _s_t_r_u_c_t _n_l_i_s_t _*_n_l); + +DDEESSCCRRIIPPTTIIOONN + The nnlliisstt() function retrieves name list entries from the symbol table of + an exectutable file. (See a.out(5).) The argument _n_l is set to reference + the beginning of the list. The list is preened of binary and invalid da- + ta; if an entry in the name list is valid, the _n___t_y_p_e and _n___v_a_l_u_e for the + entry are copied into the list referenced by _n_l. No other data is copied. + The last entry in the list is always NULL. + +RREETTUURRNN VVAALLUUEESS + The number of invalid entries is returned if successful; otherwise, if + the file _f_i_l_e_n_a_m_e does not exist or is not exectuable, the returned value + is -1. + +SSEEEE AALLSSOO + a.out(5) + +HHIISSTTOORRYY + A nnlliisstt() function appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ns.0 b/usr/share/man/cat3/ns.0 new file mode 100644 index 0000000000..9592dc89f1 --- /dev/null +++ b/usr/share/man/cat3/ns.0 @@ -0,0 +1,59 @@ +NS(3) BSD Programmer's Manual NS(3) + +NNAAMMEE + nnss__aaddddrr, nnss__nnttooaa - Xerox NS(tm) address conversion routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_s___a_d_d_r + nnss__aaddddrr(_c_h_a_r _*_c_p); + + _c_h_a_r _* + nnss__nnttooaa(_s_t_r_u_c_t _n_s___a_d_d_r _n_s); + +DDEESSCCRRIIPPTTIIOONN + The routine nnss__aaddddrr() interprets character strings representing XNS ad- + dresses, returning binary information suitable for use in system calls. + The routine nnss__nnttooaa() takes XNS addresses and returns ASCII strings rep- + resenting the address in a notation in common use in the Xerox Develop- + ment Environment: + + .. + + Trailing zero fields are suppressed, and each number is printed in hex- + adecimal, in a format suitable for input to nnss__aaddddrr(). Any fields lack- + ing super-decimal digits will have a trailing `H' appended. + + Unfortunately, no universal standard exists for representing XNS address- + es. An effort has been made to insure that nnss__aaddddrr() be compatible with + most formats in common use. It will first separate an address into 1 to + 3 fields using a single delimiter chosen from period `.', colon `:' or + pound-sign `#'. Each field is then examined for byte separators (colon or + period). If there are byte separators, each subfield separated is taken + to be a small hexadecimal number, and the entirety is taken as a network- + byte-ordered quantity to be zero extended in the high-network-order + bytes. Next, the field is inspected for hyphens, in which case the field + is assumed to be a number in decimal notation with hyphens separating the + millenia. Next, the field is assumed to be a number: It is interpreted + as hexadecimal if there is a leading `0x' (as in C), a trailing `H' (as + in Mesa), or there are any super-decimal digits present. It is inter- + preted as octal is there is a leading `0' and there are no super-octal + digits. Otherwise, it is converted as a decimal number. + +RREETTUURRNN VVAALLUUEESS + None. (See _B_U_G_S.) + +SSEEEE AALLSSOO + hosts(5), networks(5), + +HHIISSTTOORRYY + The nnss__aaddddrr() and nnss__ttooaa() functions appeared in 4.3BSD. + +BBUUGGSS + The string returned by nnss__nnttooaa() resides in a static memory area. The + function nnss__aaddddrr() should diagnose improperly formed input, and there + should be an unambiguous way to recognize this. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ns_addr.0 b/usr/share/man/cat3/ns_addr.0 new file mode 100644 index 0000000000..9592dc89f1 --- /dev/null +++ b/usr/share/man/cat3/ns_addr.0 @@ -0,0 +1,59 @@ +NS(3) BSD Programmer's Manual NS(3) + +NNAAMMEE + nnss__aaddddrr, nnss__nnttooaa - Xerox NS(tm) address conversion routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_s___a_d_d_r + nnss__aaddddrr(_c_h_a_r _*_c_p); + + _c_h_a_r _* + nnss__nnttooaa(_s_t_r_u_c_t _n_s___a_d_d_r _n_s); + +DDEESSCCRRIIPPTTIIOONN + The routine nnss__aaddddrr() interprets character strings representing XNS ad- + dresses, returning binary information suitable for use in system calls. + The routine nnss__nnttooaa() takes XNS addresses and returns ASCII strings rep- + resenting the address in a notation in common use in the Xerox Develop- + ment Environment: + + .. + + Trailing zero fields are suppressed, and each number is printed in hex- + adecimal, in a format suitable for input to nnss__aaddddrr(). Any fields lack- + ing super-decimal digits will have a trailing `H' appended. + + Unfortunately, no universal standard exists for representing XNS address- + es. An effort has been made to insure that nnss__aaddddrr() be compatible with + most formats in common use. It will first separate an address into 1 to + 3 fields using a single delimiter chosen from period `.', colon `:' or + pound-sign `#'. Each field is then examined for byte separators (colon or + period). If there are byte separators, each subfield separated is taken + to be a small hexadecimal number, and the entirety is taken as a network- + byte-ordered quantity to be zero extended in the high-network-order + bytes. Next, the field is inspected for hyphens, in which case the field + is assumed to be a number in decimal notation with hyphens separating the + millenia. Next, the field is assumed to be a number: It is interpreted + as hexadecimal if there is a leading `0x' (as in C), a trailing `H' (as + in Mesa), or there are any super-decimal digits present. It is inter- + preted as octal is there is a leading `0' and there are no super-octal + digits. Otherwise, it is converted as a decimal number. + +RREETTUURRNN VVAALLUUEESS + None. (See _B_U_G_S.) + +SSEEEE AALLSSOO + hosts(5), networks(5), + +HHIISSTTOORRYY + The nnss__aaddddrr() and nnss__ttooaa() functions appeared in 4.3BSD. + +BBUUGGSS + The string returned by nnss__nnttooaa() resides in a static memory area. The + function nnss__aaddddrr() should diagnose improperly formed input, and there + should be an unambiguous way to recognize this. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ns_ntoa.0 b/usr/share/man/cat3/ns_ntoa.0 new file mode 100644 index 0000000000..9592dc89f1 --- /dev/null +++ b/usr/share/man/cat3/ns_ntoa.0 @@ -0,0 +1,59 @@ +NS(3) BSD Programmer's Manual NS(3) + +NNAAMMEE + nnss__aaddddrr, nnss__nnttooaa - Xerox NS(tm) address conversion routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_s___a_d_d_r + nnss__aaddddrr(_c_h_a_r _*_c_p); + + _c_h_a_r _* + nnss__nnttooaa(_s_t_r_u_c_t _n_s___a_d_d_r _n_s); + +DDEESSCCRRIIPPTTIIOONN + The routine nnss__aaddddrr() interprets character strings representing XNS ad- + dresses, returning binary information suitable for use in system calls. + The routine nnss__nnttooaa() takes XNS addresses and returns ASCII strings rep- + resenting the address in a notation in common use in the Xerox Develop- + ment Environment: + + .. + + Trailing zero fields are suppressed, and each number is printed in hex- + adecimal, in a format suitable for input to nnss__aaddddrr(). Any fields lack- + ing super-decimal digits will have a trailing `H' appended. + + Unfortunately, no universal standard exists for representing XNS address- + es. An effort has been made to insure that nnss__aaddddrr() be compatible with + most formats in common use. It will first separate an address into 1 to + 3 fields using a single delimiter chosen from period `.', colon `:' or + pound-sign `#'. Each field is then examined for byte separators (colon or + period). If there are byte separators, each subfield separated is taken + to be a small hexadecimal number, and the entirety is taken as a network- + byte-ordered quantity to be zero extended in the high-network-order + bytes. Next, the field is inspected for hyphens, in which case the field + is assumed to be a number in decimal notation with hyphens separating the + millenia. Next, the field is assumed to be a number: It is interpreted + as hexadecimal if there is a leading `0x' (as in C), a trailing `H' (as + in Mesa), or there are any super-decimal digits present. It is inter- + preted as octal is there is a leading `0' and there are no super-octal + digits. Otherwise, it is converted as a decimal number. + +RREETTUURRNN VVAALLUUEESS + None. (See _B_U_G_S.) + +SSEEEE AALLSSOO + hosts(5), networks(5), + +HHIISSTTOORRYY + The nnss__aaddddrr() and nnss__ttooaa() functions appeared in 4.3BSD. + +BBUUGGSS + The string returned by nnss__nnttooaa() resides in a static memory area. The + function nnss__aaddddrr() should diagnose improperly formed input, and there + should be an unambiguous way to recognize this. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ntoa.0 b/usr/share/man/cat3/ntoa.0 new file mode 100644 index 0000000000..f8e9f6fa6b --- /dev/null +++ b/usr/share/man/cat3/ntoa.0 @@ -0,0 +1,104 @@ +INET(3) BSD Programmer's Manual INET(3) + +NNAAMMEE + iinneett__aattoonn, iinneett__aaddddrr, iinneett__nneettwwoorrkk, iinneett__nnttooaa, iinneett__mmaakkeeaaddddrr, iinneett__llnnaaooff, + iinneett__nneettooff - Internet address manipulation routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + iinneett__aattoonn(_c_h_a_r _*_c_p, _s_t_r_u_c_t _i_n___a_d_d_r _*_p_i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__aaddddrr(_c_h_a_r _*_c_p); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettwwoorrkk(_c_h_a_r _*_c_p); + + _c_h_a_r _* + iinneett__nnttooaa(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _s_t_r_u_c_t _i_n___a_d_d_r + iinneett__mmaakkeeaaddddrr(_i_n_t _n_e_t, _i_n_t _l_n_a); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__llnnaaooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + + _u_n_s_i_g_n_e_d _l_o_n_g + iinneett__nneettooff(_s_t_r_u_c_t _i_n___a_d_d_r _i_n); + +DDEESSCCRRIIPPTTIIOONN + The routines iinneett__aattoonn(), iinneett__aaddddrr() and iinneett__nneettwwoorrkk() interpret char- + acter strings representing numbers expressed in the Internet standard `.' + notation. The iinneett__aattoonn() routine interprets the specified character + string as an Internet address, placing the address into the structure + provided. It returns 1 if the string was successfully interpreted, or 0 + if the string is invalid. The iinneett__aaddddrr() and iinneett__nneettwwoorrkk() functions + return numbers suitable for use as Internet addresses and Internet net- + work numbers, respectively. The routine iinneett__nnttooaa() takes an Internet + address and returns an ASCII string representing the address in `.' nota- + tion. The routine iinneett__mmaakkeeaaddddrr() takes an Internet network number and a + local network address and constructs an Internet address from it. The + routines iinneett__nneettooff() and iinneett__llnnaaooff() break apart Internet host address- + es, returning the network number and local network address part, respec- + tively. + + All Internet addresses are returned in network order (bytes ordered from + left to right). All network numbers and local address parts are returned + as machine format integer values. + +IINNTTEERRNNEETT AADDDDRREESSSSEESS + Values specified using the `.' notation take one of the following forms: + + a.b.c.d + a.b.c + a.b + a + + When four parts are specified, each is interpreted as a byte of data and + assigned, from left to right, to the four bytes of an Internet address. + Note that when an Internet address is viewed as a 32-bit integer quantity + on the VAX the bytes referred to above appear as ``d.c.b.a''. That is, + VAX bytes are ordered from right to left. + + When a three part address is specified, the last part is interpreted as a + 16-bit quantity and placed in the right-most two bytes of the network ad- + dress. This makes the three part address format convenient for specify- + ing Class B network addresses as ``128.net.host''. + + When a two part address is supplied, the last part is interpreted as a + 24-bit quantity and placed in the right most three bytes of the network + address. This makes the two part address format convenient for specify- + ing Class A network addresses as ``net.host''. + + When only one part is given, the value is stored directly in the network + address without any byte rearrangement. + + All numbers supplied as ``parts'' in a `.' notation may be decimal, oc- + tal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). + +DDIIAAGGNNOOSSTTIICCSS + The constant INADDR_NONE is returned by iinneett__aaddddrr() and iinneett__nneettwwoorrkk() + for malformed requests. + +SSEEEE AALLSSOO + gethostbyname(3), getnetent(3), hosts(5), networks(5), + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + The value INADDR_NONE (0xffffffff) is a valid broadcast address, but + iinneett__aaddddrr() cannot return that value without indicating failure. The + newer iinneett__aattoonn() function does not share this problem. The problem of + host byte ordering versus network byte ordering is confusing. The string + returned by iinneett__nnttooaa() resides in a static memory area. + + Inet_addr should return a _s_t_r_u_c_t _i_n___a_d_d_r. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/ntohl.0 b/usr/share/man/cat3/ntohl.0 new file mode 100644 index 0000000000..a147b31181 --- /dev/null +++ b/usr/share/man/cat3/ntohl.0 @@ -0,0 +1,40 @@ +BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) + +NNAAMMEE + hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte + order + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___l_o_n_g + hhttoonnll(_u___l_o_n_g _h_o_s_t_l_o_n_g); + + _u___s_h_o_r_t + hhttoonnss(_u___s_h_o_r_t _h_o_s_t_s_h_o_r_t); + + _u___l_o_n_g + nnttoohhll(_u___l_o_n_g _n_e_t_l_o_n_g); + + _u___s_h_o_r_t + nnttoohhss(_u___s_h_o_r_t _n_e_t_s_h_o_r_t); + +DDEESSCCRRIIPPTTIIOONN + These routines convert 16 and 32 bit quantities between network byte or- + der and host byte order. On machines which have a byte order which is + the same as the network order, routines are defined as null macros. + + These routines are most often used in conjunction with Internet addresses + and ports as returned by gethostbyname(3) and getservent(3). + +SSEEEE AALLSSOO + gethostbyname(3), getservent(3) + +HHIISSTTOORRYY + The bbyytteeoorrddeerr functions appeared in 4.2BSD. + +BBUUGGSS + On the VAX bytes are handled backwards from most everyone else in the + world. This is not expected to be fixed in the near future. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ntohs.0 b/usr/share/man/cat3/ntohs.0 new file mode 100644 index 0000000000..a147b31181 --- /dev/null +++ b/usr/share/man/cat3/ntohs.0 @@ -0,0 +1,40 @@ +BYTEORDER(3) BSD Programmer's Manual BYTEORDER(3) + +NNAAMMEE + hhttoonnll, hhttoonnss, nnttoohhll, nnttoohhss - convert values between host and network byte + order + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___l_o_n_g + hhttoonnll(_u___l_o_n_g _h_o_s_t_l_o_n_g); + + _u___s_h_o_r_t + hhttoonnss(_u___s_h_o_r_t _h_o_s_t_s_h_o_r_t); + + _u___l_o_n_g + nnttoohhll(_u___l_o_n_g _n_e_t_l_o_n_g); + + _u___s_h_o_r_t + nnttoohhss(_u___s_h_o_r_t _n_e_t_s_h_o_r_t); + +DDEESSCCRRIIPPTTIIOONN + These routines convert 16 and 32 bit quantities between network byte or- + der and host byte order. On machines which have a byte order which is + the same as the network order, routines are defined as null macros. + + These routines are most often used in conjunction with Internet addresses + and ports as returned by gethostbyname(3) and getservent(3). + +SSEEEE AALLSSOO + gethostbyname(3), getservent(3) + +HHIISSTTOORRYY + The bbyytteeoorrddeerr functions appeared in 4.2BSD. + +BBUUGGSS + On the VAX bytes are handled backwards from most everyone else in the + world. This is not expected to be fixed in the near future. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/opendir.0 b/usr/share/man/cat3/opendir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/opendir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/openlog.0 b/usr/share/man/cat3/openlog.0 new file mode 100644 index 0000000000..cbcb3a15d5 --- /dev/null +++ b/usr/share/man/cat3/openlog.0 @@ -0,0 +1,150 @@ +SYSLOG(3) BSD Programmer's Manual SYSLOG(3) + +NNAAMMEE + ssyysslloogg, vvssyysslloogg, ooppeennlloogg, cclloosseelloogg, sseettllooggmmaasskk - control system log + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + ssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _._._.); + + _v_o_i_d + vvssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + ooppeennlloogg(_c_o_n_s_t _c_h_a_r _*_i_d_e_n_t, _i_n_t _l_o_g_o_p_t, _i_n_t _f_a_c_i_l_i_t_y); + + _v_o_i_d + cclloosseelloogg(_v_o_i_d); + + _i_n_t + sseettllooggmmaasskk(_i_n_t _m_a_s_k_p_r_i); + +DDEESSCCRRIIPPTTIIOONN + The ssyysslloogg() function writes _m_e_s_s_a_g_e to the system message logger. The + message is then written to the system console, log files, logged-in + users, or forwarded to other machines as appropriate. (See syslogd(8).) + + The message is identical to a printf(3) format string, except that `%m' + is replaced by the current error message. (As denoted by the global vari- + able _e_r_r_n_o; see strerror(3).) A trailing newline is added if none is + present. + + The vvssyysslloogg() function is an alternate form in which the arguments have + already been captured using the variable-length argument facilities of + varargs(3). + + The message is tagged with _p_r_i_o_r_i_t_y. Priorities are encoded as a _f_a_c_i_l_i_t_y + and a _l_e_v_e_l. The facility describes the part of the system generating the + message. The level is selected from the following _o_r_d_e_r_e_d (high to low) + list: + + LOG_EMERG A panic condition. This is normally broadcast to all + users. + + LOG_ALERT A condition that should be corrected immediately, such as a + corrupted system database. + + LOG_CRIT Critical conditions, e.g., hard device errors. + + LOG_ERR Errors. + + LOG_WARNING Warning messages. + + LOG_NOTICE Conditions that are not error conditions, but should possi- + bly be handled specially. + + LOG_INFO Informational messages. + + LOG_DEBUG Messages that contain information normally of use only when + debugging a program. + + The ooppeennlloogg() function provides for more specialized processing of the + messages sent by ssyysslloogg() and vvssyysslloogg(). The parameter _i_d_e_n_t is a string + that will be prepended to every message. The _l_o_g_o_p_t argument is a bit + field specifying logging options, which is formed by OR'ing one or more + of the following values: + + LOG_CONS If ssyysslloogg() cannot pass the message to syslogd it will at- + tempt to write the message to the console + (``_/_d_e_v_/_c_o_n_s_o_l_e_.'') + + LOG_NDELAY Open the connection to syslogd immediately. Normally the + open is delayed until the first message is logged. Useful + for programs that need to manage the order in which file + descriptors are allocated. + + LOG_PERROR Write the message to standard error output as well to the + system log. + + LOG_PID Log the process id with each message: useful for identify- + ing instantiations of daemons. + + The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all + messages that do not have an explicit facility encoded: + + LOG_AUTH The authorization system: login(1), su(1), getty(8), + etc. + + LOG_AUTHPRIV The same as LOG_AUTH, but logged to a file readable only by + selected individuals. + + LOG_CRON The clock daemon. + + LOG_DAEMON System daemons, such as routed(8), that are not provided + for explicitly by other facilities. + + LOG_KERN Messages generated by the kernel. These cannot be generat- + ed by any user processes. + + LOG_LPR The line printer spooling system: lpr(1), lpc(8), lpd(8), + etc. + + LOG_MAIL The mail system. + + LOG_NEWS The network news system. + + LOG_SYSLOG Messages generated internally by syslogd(8). + + LOG_USER Messages generated by random user processes. This is the + default facility identifier if none is specified. + + LOG_UUCP The uucp system. + + LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through + LOG_LOCAL7. + + The cclloosseelloogg() function can be used to close the log file. + + The sseettllooggmmaasskk() function sets the log priority mask to _m_a_s_k_p_r_i and re- + turns the previous mask. Calls to ssyysslloogg() with a priority not set in + _m_a_s_k_p_r_i are rejected. The mask for an individual priority _p_r_i is calcu- + lated by the macro LLOOGG__MMAASSKK(_p_r_i); the mask for all priorities up to and + including _t_o_p_p_r_i is given by the macro LLOOGG__UUPPTTOO(_t_o_p_p_r_i);. The default al- + lows all priorities to be logged. + +RREETTUURRNN VVAALLUUEESS + The routines cclloosseelloogg(), ooppeennlloogg(), ssyysslloogg() and vvssyysslloogg() return no val- + ue. + + + The routine sseettllooggmmaasskk() always returns the previous log mask level. + +EEXXAAMMPPLLEESS + syslog(LOG_ALERT, "who: internal error 23"); + + openlog("ftpd", LOG_PID, LOG_DAEMON); + setlogmask(LOG_UPTO(LOG_ERR)); + syslog(LOG_INFO, "Connection from host %d", CallingHost); + + syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); + +SSEEEE AALLSSOO + logger(1), syslogd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/pause.0 b/usr/share/man/cat3/pause.0 new file mode 100644 index 0000000000..a72b644721 --- /dev/null +++ b/usr/share/man/cat3/pause.0 @@ -0,0 +1,34 @@ +PAUSE(3) BSD Programmer's Manual PAUSE(3) + +NNAAMMEE + ppaauussee - stop until signal + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ppaauussee(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + PPaauussee iiss mmaaddee oobbssoolleettee bbyy ssiiggppaauussee((33)).. + + The ppaauussee() function forces a process to pause until a signal is received + from either the kill(2) function or an interval timer. (See + setitimer(2).) Upon termination of a signal handler started during a + ppaauussee(), the ppaauussee() call will return. + +RREETTUURRNN VVAALLUUEESS + Always returns -1. + +EERRRROORRSS + The ppaauussee() function always returns: + + [EINTR] The call was interrupted. + +SSEEEE AALLSSOO + kill(2), select(2), sigpause(2) + +HHIISSTTOORRYY + A ppaauussee() syscall appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/pclose.0 b/usr/share/man/cat3/pclose.0 new file mode 100644 index 0000000000..94614c6943 --- /dev/null +++ b/usr/share/man/cat3/pclose.0 @@ -0,0 +1,73 @@ +POPEN(3) BSD Programmer's Manual POPEN(3) + +NNAAMMEE + ppooppeenn, ppcclloossee - process I/O + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ppooppeenn(_c_o_n_s_t _c_h_a_r _*_c_o_m_m_a_n_d, _c_o_n_s_t _c_h_a_r _*_t_y_p_e); + + _i_n_t + ppcclloossee(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ppooppeenn() function ``opens'' a process by creating a pipe, forking, and + invoking the shell. Since a pipe is by definition unidirectional, the + _t_y_p_e argument may specify only reading or writing, not both; the result- + ing stream is correspondingly read-only or write-only. + + The _c_o_m_m_a_n_d argument is a pointer to a null-terminated string containing + a shell command line. This command is passed to _/_b_i_n_/_s_h using the --cc + flag; interpretation, if any, is performed by the shell. The _m_o_d_e argu- + ment is a pointer to a null-terminated string which must be either `r' + for reading or `w' for writing. + + The return value from ppooppeenn() is a normal standard I/O stream in all re- + spects save that it must be closed with ppcclloossee() rather than ffcclloossee(). + 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 + ppooppeenn(), unless this is altered by the command itself. Conversely, read- + ing 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 ppooppeenn(). + + Note that output ppooppeenn() streams are fully buffered by default. + + The ppcclloossee() function waits for the associated process to terminate and + returns the exit status of the command as returned by wwaaiitt44(). + +RREETTUURRNN VVAALLUUEE + The ppooppeenn() function returns NULL if the fork(2) or pipe(2) calls fail, + or if it cannot allocate memory. + + The ppcclloossee() function returns -1 if _s_t_r_e_a_m is not associated with a + ``popened'' command, if _s_t_r_e_a_m already ``pclosed'', or if wait4 returns + an error. + +EERRRROORRSS + The ppooppeenn() function does not reliably set _e_r_r_n_o. + +SSEEEE AALLSSOO + fork(2), sh(1), pipe(2), wait4(2), fflush(3), fclose(3), fopen(3), + stdio(3), system(3) + +BBUUGGSS + Since the standard input of a command opened for reading shares its seek + offset with the process that called ppooppeenn(), if the original process has + done a buffered read, the command's input position may not be as expect- + ed. Similarly, the output from a command opened for writing may become + intermingled with that of the original process. The latter can be avoid- + ed by calling fflush(3) before ppooppeenn(). + + Failure to execute the shell is indistinguishable from the shell's fail- + ure to execute command, or an immediate exit of the command. The only + hint is an exit status of 127. + + The ppooppeenn() argument always calls sh, never calls csh. + +HHIISSTTOORRYY + A ppooppeenn() and a ppcclloossee() function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/perror.0 b/usr/share/man/cat3/perror.0 new file mode 100644 index 0000000000..32b9186a26 --- /dev/null +++ b/usr/share/man/cat3/perror.0 @@ -0,0 +1,52 @@ +STRERROR(3) BSD Programmer's Manual STRERROR(3) + +NNAAMMEE + ppeerrrroorr, ssttrreerrrroorr, ssyyss__eerrrrlliisstt, ssyyss__nneerrrr - system error messages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ppeerrrroorr(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___e_r_r_l_i_s_t_[_]_; + _e_x_t_e_r_n _i_n_t _s_y_s___n_e_r_r_; + + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrreerrrroorr(_i_n_t _e_r_r_n_u_m); + +DDEESSCCRRIIPPTTIIOONN + The ssttrreerrrroorr() and ppeerrrroorr() functions look up the error message string + corresponding to an error number. + + The ssttrreerrrroorr() function accepts an error number argument _e_r_r_n_u_m and re- + turns a pointer to the corresponding message string. + + The ppeerrrroorr() function finds the error message corresponding to the cur- + rent value of the global variable _e_r_r_n_o (intro(2)) and writes it, fol- + lowed by a newline, to the standard error file descriptor. If the argu- + ment _s_t_r_i_n_g is non-NULL, it is prepended to the message string and sepa- + rated from it by a colon and space (`: '). If _s_t_r_i_n_g is NULL, only the + error message string is printed. + + If _e_r_r_n_u_m is not a recognized error number, the error message string will + contain ``Unknown error: '' followed by the error number in decimal. + + The message strings can be accessed directly using the external array + _s_y_s___e_r_r_l_i_s_t. The external value _s_y_s___n_e_r_r contains a count of the messages + in _s_y_s___e_r_r_l_i_s_t. The use of these variables is deprecated; ssttrreerrrroorr() + should be used instead. + +SSEEEE AALLSSOO + intro(2), psignal(3) + +HHIISSTTOORRYY + The ssttrreerrrroorr() and ppeerrrroorr() functions first appeared in 4.4BSD. + +BBUUGGSS + For unknown error numbers, the ssttrreerrrroorr() function will return its result + in a static buffer which may be overwritten by subsequent calls. + +4th Berkeley Distribution June 9, 1993 1 diff --git a/usr/share/man/cat3/popen.0 b/usr/share/man/cat3/popen.0 new file mode 100644 index 0000000000..94614c6943 --- /dev/null +++ b/usr/share/man/cat3/popen.0 @@ -0,0 +1,73 @@ +POPEN(3) BSD Programmer's Manual POPEN(3) + +NNAAMMEE + ppooppeenn, ppcclloossee - process I/O + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ppooppeenn(_c_o_n_s_t _c_h_a_r _*_c_o_m_m_a_n_d, _c_o_n_s_t _c_h_a_r _*_t_y_p_e); + + _i_n_t + ppcclloossee(_F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ppooppeenn() function ``opens'' a process by creating a pipe, forking, and + invoking the shell. Since a pipe is by definition unidirectional, the + _t_y_p_e argument may specify only reading or writing, not both; the result- + ing stream is correspondingly read-only or write-only. + + The _c_o_m_m_a_n_d argument is a pointer to a null-terminated string containing + a shell command line. This command is passed to _/_b_i_n_/_s_h using the --cc + flag; interpretation, if any, is performed by the shell. The _m_o_d_e argu- + ment is a pointer to a null-terminated string which must be either `r' + for reading or `w' for writing. + + The return value from ppooppeenn() is a normal standard I/O stream in all re- + spects save that it must be closed with ppcclloossee() rather than ffcclloossee(). + 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 + ppooppeenn(), unless this is altered by the command itself. Conversely, read- + ing 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 ppooppeenn(). + + Note that output ppooppeenn() streams are fully buffered by default. + + The ppcclloossee() function waits for the associated process to terminate and + returns the exit status of the command as returned by wwaaiitt44(). + +RREETTUURRNN VVAALLUUEE + The ppooppeenn() function returns NULL if the fork(2) or pipe(2) calls fail, + or if it cannot allocate memory. + + The ppcclloossee() function returns -1 if _s_t_r_e_a_m is not associated with a + ``popened'' command, if _s_t_r_e_a_m already ``pclosed'', or if wait4 returns + an error. + +EERRRROORRSS + The ppooppeenn() function does not reliably set _e_r_r_n_o. + +SSEEEE AALLSSOO + fork(2), sh(1), pipe(2), wait4(2), fflush(3), fclose(3), fopen(3), + stdio(3), system(3) + +BBUUGGSS + Since the standard input of a command opened for reading shares its seek + offset with the process that called ppooppeenn(), if the original process has + done a buffered read, the command's input position may not be as expect- + ed. Similarly, the output from a command opened for writing may become + intermingled with that of the original process. The latter can be avoid- + ed by calling fflush(3) before ppooppeenn(). + + Failure to execute the shell is indistinguishable from the shell's fail- + ure to execute command, or an immediate exit of the command. The only + hint is an exit status of 127. + + The ppooppeenn() argument always calls sh, never calls csh. + +HHIISSTTOORRYY + A ppooppeenn() and a ppcclloossee() function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/printf.0 b/usr/share/man/cat3/printf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/printf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/psignal.0 b/usr/share/man/cat3/psignal.0 new file mode 100644 index 0000000000..0d317e40b4 --- /dev/null +++ b/usr/share/man/cat3/psignal.0 @@ -0,0 +1,37 @@ +PSIGNAL(3) BSD Programmer's Manual PSIGNAL(3) + +NNAAMMEE + ppssiiggnnaall, ssyyss__ssiigglliisstt ssyyss__ssiiggnnaammee - system signal messages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ppssiiggnnaall(_u_n_s_i_g_n_e_d _s_i_g, _c_o_n_s_t _c_h_a_r _*_s); + + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___s_i_g_l_i_s_t_[_]_; + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___s_i_g_n_a_m_e_[_]_; + +DDEESSCCRRIIPPTTIIOONN + The ppssiiggnnaall() function locates the descriptive message string for the + given signal number _s_i_g and writes it to the standard error. + + If the argument _s is non-NULL it is written to the standard error file + descriptor prior to the message string, immediately followed by a colon + and a space. If the signal number is not recognized (sigaction(2)), the + string ``Unknown signal'' is produced. + + The message strings can be accessed directly through the external array + _s_y_s___s_i_g_l_i_s_t, indexed by recognized signal numbers. The external array + _s_y_s___s_i_g_n_a_m_e is used similarly and contains short, lower-case abbrevia- + tions for signals which are useful for recognizing signal names in user + input. The defined variable NSIG contains a count of the strings in + _s_y_s___s_i_g_l_i_s_t and _s_y_s___s_i_g_n_a_m_e. + +SSEEEE AALLSSOO + sigaction(2), perror(3) + +HHIISSTTOORRYY + The ppssiiggnnaall() function appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/putc.0 b/usr/share/man/cat3/putc.0 new file mode 100644 index 0000000000..2d3750b7a4 --- /dev/null +++ b/usr/share/man/cat3/putc.0 @@ -0,0 +1,51 @@ +PUTC(3) BSD Programmer's Manual PUTC(3) + +NNAAMMEE + ffppuuttcc, ppuuttcc, ppuuttcchhaarr, ppuuttww - output a character or word to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcchhaarr(_i_n_t _c); + + _i_n_t + ppuuttww(_i_n_t _w, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffppuuttcc() function writes the character _c (converted to an ``unsigned + char'') to the output stream pointed to by _s_t_r_e_a_m. + + PPuuttcc() acts essentially identically to ffppuuttcc(), but is a macro that ex- + pands in-line. It may evaluate _s_t_r_e_a_m more than once, so arguments given + to ppuuttcc() should not be expressions with potential side effects. + + PPuuttcchhaarr() is identical to ppuuttcc() with an output stream of _s_t_d_o_u_t. + + The ppuuttww() function writes the specified _i_n_t to the named output _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + The functions, ffppuuttcc(), ppuuttcc() and ppuuttcchhaarr() return the character writ- + ten. If an error occurs, the value EOF is returned. The ppuuttww() function + returns 0 on success; EOF is returned if a write error occurs, or if an + attempt is made to write a read-only stream. + +SSEEEE AALLSSOO + ferror(3), fopen(3), getc(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttcc(), ppuuttcc(), and ppuuttcchhaarr(), conform to ANSI C + X3.159-1989 (``ANSI C ''). A function ppuuttww() function appeared in Version + 6 AT&T UNIX. + +BBUUGGSS + The size and byte order of an _i_n_t varies from one machine to another, and + ppuuttww() is not recommended for portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/putchar.0 b/usr/share/man/cat3/putchar.0 new file mode 100644 index 0000000000..2d3750b7a4 --- /dev/null +++ b/usr/share/man/cat3/putchar.0 @@ -0,0 +1,51 @@ +PUTC(3) BSD Programmer's Manual PUTC(3) + +NNAAMMEE + ffppuuttcc, ppuuttcc, ppuuttcchhaarr, ppuuttww - output a character or word to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcchhaarr(_i_n_t _c); + + _i_n_t + ppuuttww(_i_n_t _w, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffppuuttcc() function writes the character _c (converted to an ``unsigned + char'') to the output stream pointed to by _s_t_r_e_a_m. + + PPuuttcc() acts essentially identically to ffppuuttcc(), but is a macro that ex- + pands in-line. It may evaluate _s_t_r_e_a_m more than once, so arguments given + to ppuuttcc() should not be expressions with potential side effects. + + PPuuttcchhaarr() is identical to ppuuttcc() with an output stream of _s_t_d_o_u_t. + + The ppuuttww() function writes the specified _i_n_t to the named output _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + The functions, ffppuuttcc(), ppuuttcc() and ppuuttcchhaarr() return the character writ- + ten. If an error occurs, the value EOF is returned. The ppuuttww() function + returns 0 on success; EOF is returned if a write error occurs, or if an + attempt is made to write a read-only stream. + +SSEEEE AALLSSOO + ferror(3), fopen(3), getc(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttcc(), ppuuttcc(), and ppuuttcchhaarr(), conform to ANSI C + X3.159-1989 (``ANSI C ''). A function ppuuttww() function appeared in Version + 6 AT&T UNIX. + +BBUUGGSS + The size and byte order of an _i_n_t varies from one machine to another, and + ppuuttww() is not recommended for portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/putenv.0 b/usr/share/man/cat3/putenv.0 new file mode 100644 index 0000000000..950f18b3c3 --- /dev/null +++ b/usr/share/man/cat3/putenv.0 @@ -0,0 +1,64 @@ +GETENV(3) BSD Programmer's Manual GETENV(3) + +NNAAMMEE + ggeetteennvv, ppuutteennvv, sseetteennvv, uunnsseetteennvv - environment variable functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _i_n_t + sseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _c_o_n_s_t _c_h_a_r _*_v_a_l_u_e, _i_n_t _o_v_e_r_w_r_i_t_e); + + _i_n_t + ppuutteennvv(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + uunnsseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + These functions set, unset and fetch environment variables from the host + _e_n_v_i_r_o_n_m_e_n_t _l_i_s_t. For compatibility with differing environment conven- + tions, the given arguments _n_a_m_e and _v_a_l_u_e may be appended and prepended, + respectively, with an equal sign ``=''. + + The ggeetteennvv() function obtains the current value of the environment vari- + able, _n_a_m_e. If the variable _n_a_m_e is not in the current environment , a + null pointer is returned. + + The sseetteennvv() function inserts or resets the environment variable _n_a_m_e in + the current environment list. If the variable _n_a_m_e does not exist in the + list, it is inserted with the given _v_a_l_u_e_. If the variable does exist, + the argument _o_v_e_r_w_r_i_t_e is tested; if _o_v_e_r_w_r_i_t_e _i_s zero, the variable is + not reset, otherwise it is reset to the given _v_a_l_u_e. + + The ppuutteennvv() function takes an argument of the form ``name=value'' and is + equivalent to: + + setenv(name, value, 1); + + The uunnsseetteennvv() function deletes all instances of the variable name point- + ed to by _n_a_m_e from the list. + +RREETTUURRNN VVAALLUUEESS + The functions sseetteennvv() and ppuutteennvv() return zero if successful; otherwise + the global variable _e_r_r_n_o is set to indicate the error and a -1 is re- + turned. + +EERRRROORRSS + [ENOMEM] The function sseetteennvv() or ppuutteennvv() failed because they were un- + able to allocate memory for the environment. + +SSEEEE AALLSSOO + csh(1), sh(1), execve(2), environ(7) + +SSTTAANNDDAARRDDSS + The ggeetteennvv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions sseetteennvv() and uunnsseetteennvv() appeared in Version 7 AT&T UNIX. + The ppuutteennvv() function appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/puts.0 b/usr/share/man/cat3/puts.0 new file mode 100644 index 0000000000..7636389af2 --- /dev/null +++ b/usr/share/man/cat3/puts.0 @@ -0,0 +1,39 @@ +FPUTS(3) BSD Programmer's Manual FPUTS(3) + +NNAAMMEE + ffppuuttss, ppuuttss - output a line to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttss(_c_o_n_s_t _c_h_a_r _*_s_t_r, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttss(_c_o_n_s_t _c_h_a_r _*_s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The function ffppuuttss() writes the string pointed to by _s_t_r to the stream + pointed to by _s_t_r_e_a_m. + + The function ppuuttss() writes the string _s_t_r, and a terminating newline + character, to the stream _s_t_d_o_u_t. + +RREETTUURRNN VVAALLUUEESS + The ffppuuttss() function returns 0 on success and EOF on error; ppuuttss() re- + turns a nonnegative integer on success and EOF on error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m supplied is not a writable stream. + + The functions ffppuuttss() and ppuuttss() may also fail and set _e_r_r_n_o for any of + the errors specified for the routines write(2). + +SSEEEE AALLSSOO + putc(3), ferror(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttss() and ppuuttss() conform to ANSI C X3.159-1989 (``ANSI C + ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/putw.0 b/usr/share/man/cat3/putw.0 new file mode 100644 index 0000000000..2d3750b7a4 --- /dev/null +++ b/usr/share/man/cat3/putw.0 @@ -0,0 +1,51 @@ +PUTC(3) BSD Programmer's Manual PUTC(3) + +NNAAMMEE + ffppuuttcc, ppuuttcc, ppuuttcchhaarr, ppuuttww - output a character or word to a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ppuuttcchhaarr(_i_n_t _c); + + _i_n_t + ppuuttww(_i_n_t _w, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The ffppuuttcc() function writes the character _c (converted to an ``unsigned + char'') to the output stream pointed to by _s_t_r_e_a_m. + + PPuuttcc() acts essentially identically to ffppuuttcc(), but is a macro that ex- + pands in-line. It may evaluate _s_t_r_e_a_m more than once, so arguments given + to ppuuttcc() should not be expressions with potential side effects. + + PPuuttcchhaarr() is identical to ppuuttcc() with an output stream of _s_t_d_o_u_t. + + The ppuuttww() function writes the specified _i_n_t to the named output _s_t_r_e_a_m. + +RREETTUURRNN VVAALLUUEESS + The functions, ffppuuttcc(), ppuuttcc() and ppuuttcchhaarr() return the character writ- + ten. If an error occurs, the value EOF is returned. The ppuuttww() function + returns 0 on success; EOF is returned if a write error occurs, or if an + attempt is made to write a read-only stream. + +SSEEEE AALLSSOO + ferror(3), fopen(3), getc(3), stdio(3) + +SSTTAANNDDAARRDDSS + The functions ffppuuttcc(), ppuuttcc(), and ppuuttcchhaarr(), conform to ANSI C + X3.159-1989 (``ANSI C ''). A function ppuuttww() function appeared in Version + 6 AT&T UNIX. + +BBUUGGSS + The size and byte order of an _i_n_t varies from one machine to another, and + ppuuttww() is not recommended for portable applications. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/pwcache.0 b/usr/share/man/cat3/pwcache.0 new file mode 100644 index 0000000000..5cffb4cc0f --- /dev/null +++ b/usr/share/man/cat3/pwcache.0 @@ -0,0 +1,33 @@ +PWCACHE(3) BSD Programmer's Manual PWCACHE(3) + +NNAAMMEE + ppwwccaacchhee - cache password and group entries + +SSYYNNOOPPSSIISS + uusseerr__ffrroomm__uuiidd(_u_i_d___t _u_i_d, _i_n_t _n_o_u_s_e_r); + + ggrroouupp__ffrroomm__ggiidd(_g_i_d___t _g_i_d, _i_n_t _n_o_g_r_o_u_p); + +DDEESSCCRRIIPPTTIIOONN + The uusseerr__ffrroomm__uuiidd() function returns the user name associated with the + argument _u_i_d. The user name is cached so that multiple calls with the + same _u_i_d do not require additional calls to getpwuid(3). If there is no + user associated with the _u_i_d, a pointer is returned to a string represen- + tation of the _u_i_d, unless the argument _n_o_u_s_e_r is non-zero, in which case + a NULL pointer is returned. + + The ggrroouupp__ffrroomm__ggiidd() function returns the group name associated with the + argument _g_i_d. The group name is cached so that multiple calls with the + same _g_i_d do not require additional calls to getgrgid(3). If there is no + group associated with the _g_i_d, a pointer is returned to a string repre- + sentation of the _g_i_d, unless the argument _n_o_g_r_o_u_p is non-zero, in which + case a NULL pointer is returned. + +SSEEEE AALLSSOO + getgrgid(3), getpwuid(3) + +HHIISSTTOORRYY + The uusseerr__ffrroomm__iidd() and ggrroouupp__ffrroomm__iidd() functions first appeared in + 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/qsort.0 b/usr/share/man/cat3/qsort.0 new file mode 100644 index 0000000000..6e2ccc10fd --- /dev/null +++ b/usr/share/man/cat3/qsort.0 @@ -0,0 +1,105 @@ +QSORT(3) BSD Programmer's Manual QSORT(3) + +NNAAMMEE + qqssoorrtt,, hheeaappssoorrtt,, mmeerrggeessoorrtt - sort functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + qqssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + hheeaappssoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + + _i_n_t + mmeerrggeessoorrtt(_v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e, + _i_n_t _(_*_c_o_m_p_a_r_)_(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_)); + +DDEESSCCRRIIPPTTIIOONN + The qqssoorrtt() function is a modified partition-exchange sort, or quicksort. + The hheeaappssoorrtt() function is a modified selection sort. The mmeerrggeessoorrtt() + function is a modified merge sort with exponential search intended for + sorting data with pre-existing order. + + The qqssoorrtt() and hheeaappssoorrtt() functions sort an array of _n_m_e_m_b objects, the + initial member of which is pointed to by _b_a_s_e. The size of each object is + specified by _s_i_z_e. MMeerrggeessoorrtt() behaves similarly, but _r_e_q_u_i_r_e_s that _s_i_z_e + be greater than ``sizeof(void *) / 2''. + + The contents of the array _b_a_s_e are sorted in ascending order according to + a comparison function pointed to by _c_o_m_p_a_r, which requires two arguments + pointing to the objects being compared. + + 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. + + The functions qqssoorrtt() and hheeaappssoorrtt() are _n_o_t stable, that is, if two mem- + bers compare as equal, their order in the sorted array is undefined. The + function mmeerrggeessoorrtt() is stable. + + The qqssoorrtt() function is an implementation of C.A.R. Hoare's ``quicksort'' + algorithm, a variant of partition-exchange sorting; in particular, see + D.E. Knuth's Algorithm Q. QQssoorrtt() takes O N lg N average time. This im- + plementation uses median selection to avoid its O N**2 worst-case behav- + ior. + + The hheeaappssoorrtt() function is an implementation of J.W.J. William's ``heap- + sort'' algorithm, a variant of selection sorting; in particular, see D.E. + Knuth's Algorithm H. HHeeaappssoorrtt() takes O N lg N worst-case time. Its + _o_n_l_y advantage over qqssoorrtt() is that it uses almost no additional memory; + while qqssoorrtt() does not allocate memory, it is implemented using recur- + sion. + + The function mmeerrggeessoorrtt() requires additional memory of size _n_m_e_m_b _* _s_i_z_e + bytes; it should be used only when space is not at a premium. + MMeerrggeessoorrtt() is optimized for data with pre-existing order; its worst case + time is O N lg N; its best case is O N. + + Normally, qqssoorrtt() is faster than mmeerrggeessoorrtt() is faster than hheeaappssoorrtt(). + Memory availability and pre-existing order in the data can make this un- + true. + +RREETTUURRNN VVAALLUUEESS + The qqssoorrtt() function returns no value. + + Upon successful completion, hheeaappssoorrtt() and mmeerrggeessoorrtt() return 0. Other- + wise, they return -1 and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + The hheeaappssoorrtt() function succeeds unless: + + [EINVAL] The _s_i_z_e argument is zero, or, the _s_i_z_e argument to + mmeerrggeessoorrtt() is less than ``sizeof(void *) / 2''. + + [ENOMEM] HHeeaappssoorrtt() or mmeerrggeessoorrtt() were unable to allocate memory. + +CCOOMMPPAATTIIBBIILLIITTYY + Previous versions of qqssoorrtt() did not permit the comparison routine itself + to call qqssoorrtt(_3). This is no longer true. + +SSEEEE AALLSSOO + sort(1), radixsort(3) + + Hoare, C.A.R., "Quicksort", _T_h_e _C_o_m_p_u_t_e_r _J_o_u_r_n_a_l, 5:1, pp. 10-15, 1962. + + Williams, J.W.J, "Heapsort", _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, 7:1, pp. 347-348, + 1964. + + Knuth, D.E., "Sorting and Searching", _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g, + Vol. 3, pp. 114-123, 145-149, 1968. + + Mcilroy, P.M., "Optimistic Sorting and Information Theoretic Complexity", + _F_o_u_r_t_h _A_n_n_u_a_l _A_C_M_-_S_I_A_M _S_y_m_p_o_s_i_u_m _o_n _D_i_s_c_r_e_t_e _A_l_g_o_r_i_t_h_m_s, January 1992. + + Bentley, J.L., "Engineering a Sort Function", _b_e_n_t_l_e_y_@_r_e_s_e_a_r_c_h_._a_t_t_._c_o_m, + January 1992. + +SSTTAANNDDAARRDDSS + The qqssoorrtt() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/radixsort.0 b/usr/share/man/cat3/radixsort.0 new file mode 100644 index 0000000000..67d990cdfd --- /dev/null +++ b/usr/share/man/cat3/radixsort.0 @@ -0,0 +1,66 @@ +RADIXSORT(3) BSD Programmer's Manual RADIXSORT(3) + +NNAAMMEE + rraaddiixxssoorrtt - radix sort + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + rraaddiixxssoorrtt(_u___c_h_a_r _*_*_b_a_s_e, _i_n_t _n_m_e_m_b, _u___c_h_a_r _*_t_a_b_l_e, _u___i_n_t _e_n_d_b_y_t_e); + + _i_n_t + ssrraaddiixxssoorrtt(_u___c_h_a_r _*_*_b_a_s_e, _i_n_t _n_m_e_m_b, _u___c_h_a_r _*_t_a_b_l_e, _u___i_n_t _e_n_d_b_y_t_e); + +DDEESSCCRRIIPPTTIIOONN + The rraaddiixxssoorrtt() and ssrraaddiixxssoorrtt() functions are implementations of radix + sort. + + These functions sort an array of pointers to byte strings, the initial + member of which is referenced by _b_a_s_e. The byte strings may contain any + values; the end of each string is denoted by the user-specified value + _e_n_d_b_y_t_e. + + Applications may specify a sort order by providing the _t_a_b_l_e argument. + If non-NULL, _t_a_b_l_e must reference an array of UCHAR_MAX + 1 bytes which + contains the sort weight of each possible byte value. The end-of-string + byte must have a sort weight of 0 or 255 (for sorting in reverse order). + More than one byte may have the same sort weight. The _t_a_b_l_e argument is + useful for applications which wish to sort different characters equally, + for example, providing a table with the same weights for A-Z as for a-z + will result in a case-insensitive sort. If _t_a_b_l_e is NULL, the contents + of the array are sorted in ascending order according to the ASCII order + of the byte strings they reference and _e_n_d_b_y_t_e has a sorting weight of 0. + + The ssrraaddiixxssoorrtt() function is stable, that is, if two elements compare as + equal, their order in the sorted array is unchanged. The ssrraaddiixxssoorrtt() + function uses additional memory sufficient to hold _n_m_e_m_b pointers. + + The rraaddiixxssoorrtt() function is not stable, but uses no additional memory. + + These functions are variants of most-significant-byte radix sorting; in + particular, see D.E. Knuth's Algorithm R and section 5.2.5, exercise 10. + They take linear time relative to the number of bytes in the strings. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion 0 is returned. Otherwise, -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + [EINVAL] The value of the _e_n_d_b_y_t_e element of _t_a_b_l_e is not 0 or 255. + + Additionally, the ssrraaddiixxssoorrtt() function may fail and set _e_r_r_n_o for any of + the errors specified for the library routine malloc(3). + +SSEEEE AALLSSOO + sort(1), qsort(3) + + Knuth, D.E., "Sorting and Searching", _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g, + Vol. 3, pp. 170-178, 1968. + + Paige, R., "Three Partition Refinement Algorithms", _S_I_A_M _J_. _C_o_m_p_u_t_., No. + 6, Vol. 16, 1987. + +HHIISSTTOORRYY + The rraaddiixxssoorrtt() function first appeared in 4.4BSD. diff --git a/usr/share/man/cat3/raise.0 b/usr/share/man/cat3/raise.0 new file mode 100644 index 0000000000..5d1e2ae315 --- /dev/null +++ b/usr/share/man/cat3/raise.0 @@ -0,0 +1,30 @@ +RAISE(3) BSD Programmer's Manual RAISE(3) + +NNAAMMEE + rraaiissee - send a signal to the current process + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rraaiissee(_i_n_t _s_i_g); + +DDEESSCCRRIIPPTTIIOONN + The rraaiissee() function sends the signal _s_i_g to the current process. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, a value of 0 is returned. Otherwise, a value + of -1 is returned and the global variable _e_r_r_n_o is set to indicate the + error. + +EERRRROORRSS + The rraaiissee() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library functions getpid(2) and kill(2). + +SSEEEE AALLSSOO + kill(2) + +SSTTAANNDDAARRDDSS + The rraaiissee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/rand.0 b/usr/share/man/cat3/rand.0 new file mode 100644 index 0000000000..fc65f44397 --- /dev/null +++ b/usr/share/man/cat3/rand.0 @@ -0,0 +1,35 @@ +RAND(3) BSD Programmer's Manual RAND(3) + +NNAAMMEE + rraanndd, ssrraanndd - bad random number generator + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ssrraanndd(_u_n_s_i_g_n_e_d _s_e_e_d); + + _i_n_t + rraanndd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy rraannddoomm((33)).. + + The rraanndd() function computes a sequence of pseudo-random integers in the + range of 0 to RAND_MAX (as defined by the header file <_s_t_d_l_i_b_._h>). + + The ssrraanndd() function sets its argument as the seed for a new sequence of + pseudo-random numbers to be returned by rraanndd(). These sequences are re- + peatable by calling ssrraanndd() with the same seed value. + + If no seed value is provided, the functions are automatically seeded with + a value of 1. + +SSEEEE AALLSSOO + random(3) + +SSTTAANNDDAARRDDSS + The rraanndd() and ssrraanndd() functions conform to ANSI C X3.159-1989 (``ANSI C + ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/random.0 b/usr/share/man/cat3/random.0 new file mode 100644 index 0000000000..20b591fdd7 --- /dev/null +++ b/usr/share/man/cat3/random.0 @@ -0,0 +1,89 @@ +RANDOM(3) BSD Programmer's Manual RANDOM(3) + +NNAAMMEE + rraannddoomm, ssrraannddoomm, iinniittssttaattee, sseettssttaattee - better random number generator; + routines for changing generators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + rraannddoomm(_v_o_i_d); + + _v_o_i_d + ssrraannddoomm(_u_n_s_i_g_n_e_d _s_e_e_d); + + _c_h_a_r _* + iinniittssttaattee(_u_n_s_i_g_n_e_d _s_e_e_d, _c_h_a_r _*_s_t_a_t_e, _i_n_t _n); + + _c_h_a_r _* + sseettssttaattee(_c_h_a_r _*_s_t_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The rraannddoomm() function uses a non-linear 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 (2**31)-1. The + period of this random number generator is very large, approximately + 16*((2**31)-1). + + The rraannddoomm()/ ssrraannddoomm() have (almost) the same calling sequence and ini- + tialization properties as rand(3)/ srand(3). The difference is that + rand produces a much less random sequence -- in fact, the low dozen bits + generated by rand go through a cyclic pattern. All the bits generated by + rraannddoomm() are usable. For example, `random()&01' will produce a random + binary value. + + Unlike srand, ssrraannddoomm() does not return the old seed; the reason for + this is that the amount of state information used is much more than a + single word. (Two other routines are provided to deal with restart- + ing/changing random number generators). Like rand(3), however, rraannddoomm() + will by default produce a sequence of numbers that can be duplicated by + calling ssrraannddoomm() with `1' as the seed. + + The iinniittssttaattee() routine allows a state array, passed in as an argument, + to be initialized for future use. The size of the state array (in bytes) + is used by iinniittssttaattee() to decide how sophisticated a random number gener- + ator it should use -- the more state, the better the random numbers will + be. (Current "optimal" values for the amount of state information 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.) The + seed for the initialization (which specifies a starting point for the + random number sequence, and provides for restarting at the same point) is + also an argument. The iinniittssttaattee() function returns a pointer to the pre- + vious state information array. + + Once a state has been initialized, the sseettssttaattee() routine provides for + rapid switching between states. The sseettssttaattee() function returns a point- + er to the previous state array; its argument state array is used for fur- + ther random number generation until the next call to iinniittssttaattee() or + sseettssttaattee(). + + Once a state array has been initialized, it may be restarted at a differ- + ent point either by calling iinniittssttaattee() (with the desired seed, the state + array, and its size) or by calling both sseettssttaattee() (with the state array) + and ssrraannddoomm() (with the desired seed). The advantage of calling both + sseettssttaattee() and ssrraannddoomm() is that the size of the state array does not + have to be remembered after it is initialized. + + With 256 bytes of state information, the period of the random number gen- + erator is greater than 2**69 which should be sufficient for most purpos- + es. + +AAUUTTHHOORR + Earl T. Cohen + +DDIIAAGGNNOOSSTTIICCSS + If iinniittssttaattee() is called with less than 8 bytes of state information, or + if sseettssttaattee() detects that the state information has been garbled, error + messages are printed on the standard error output. + +SSEEEE AALLSSOO + rand(3) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + About 2/3 the speed of rand(3). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/rcmd.0 b/usr/share/man/cat3/rcmd.0 new file mode 100644 index 0000000000..446362aca7 --- /dev/null +++ b/usr/share/man/cat3/rcmd.0 @@ -0,0 +1,96 @@ +RCMD(3) BSD Programmer's Manual RCMD(3) + +NNAAMMEE + rrccmmdd, rrrreessvvppoorrtt, rruusseerrookk - routines for returning a stream to a remote + command + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rrccmmdd(_c_h_a_r _*_*_a_h_o_s_t, _i_n_t _i_n_p_o_r_t, _c_o_n_s_t _c_h_a_r _*_l_o_c_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_e_m_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_c_m_d, _i_n_t _*_f_d_2_p); + + _i_n_t + rrrreessvvppoorrtt(_i_n_t _*_p_o_r_t); + + _i_n_t + iirruusseerrookk(_u___l_o_n_g _r_a_d_d_r, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + + _i_n_t + rruusseerrookk(_c_o_n_s_t _c_h_a_r _*_r_h_o_s_t, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + +DDEESSCCRRIIPPTTIIOONN + The rrccmmdd() function is used by the super-user to execute a command on a + remote machine using an authentication scheme based on reserved port num- + bers. The rrrreessvvppoorrtt() function returns a descriptor to a socket with an + address in the privileged port space. The rruusseerrookk() function is used by + servers to authenticate clients requesting service with rrccmmdd(). All + three functions are present in the same file and are used by the rshd(8) + server (among others). + + The rrccmmdd() function looks up the host _*_a_h_o_s_t using gethostbyname(3), re- + turning -1 if the host does not exist. Otherwise _*_a_h_o_s_t is set to the + standard name of the host and a connection is established to a server re- + siding at the well-known Internet port _i_n_p_o_r_t. + + If the connection succeeds, a socket in the Internet domain of type + SOCK_STREAM is returned to the caller, and given to the remote command as + _s_t_d_i_n and _s_t_d_o_u_t. If _f_d_2_p is non-zero, then an auxiliary channel to a + control process will be set up, and a descriptor for it will be placed in + _*_f_d_2_p. 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 _f_d_2_p is 0, then the _s_t_d_e_r_r (unit 2 of the remote command) + will be made the same as the _s_t_d_o_u_t 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. + + The protocol is described in detail in rshd(8). + + The rrrreessvvppoorrtt() function is used to obtain a socket with a privileged ad- + dress bound to it. This socket is suitable for use by rrccmmdd() and several + other functions. Privileged Internet ports are those in the range 0 to + 1023. Only the super-user is allowed to bind an address of this sort to + a socket. + + The iirruusseerrookk() and rruusseerrookk() functions take a remote host's IP address or + name, as returned by the gethostbyname(3) routines, two user names and a + flag indicating whether the local user's name is that of the super-user. + Then, if the user is _N_O_T the super-user, it checks the _/_e_t_c_/_h_o_s_t_s_._e_q_u_i_v + file. If that lookup is not done, or is unsuccessful, the _._r_h_o_s_t_s in the + local user's home directory is checked to see if the request for service + is allowed. + + If this file does not exist, is not a regular file, is owned by anyone + other than the user or the super-user, or is writeable by anyone other + than the owner, the check automatically fails. Zero is returned if the + machine name is listed in the ``_h_o_s_t_s_._e_q_u_i_v'' file, or the host and re- + mote user name are found in the ``_._r_h_o_s_t_s'' file; otherwise iirruusseerrookk() + and rruusseerrookk() return -1. If the local domain (as obtained from + gethostname(2)) is the same as the remote domain, only the machine name + need be specified. + + The iirruusseerrookk() function is strongly preferred for security reasons. It + requires trusting the local DNS at most, while the rruusseerrookk() function re- + quires trusting the entire DNS, which can be spoofed. + +DDIIAAGGNNOOSSTTIICCSS + The rrccmmdd() function returns a valid socket descriptor on success. It re- + turns -1 on error and prints a diagnostic message on the standard error. + + The rrrreessvvppoorrtt() function returns a valid, bound socket descriptor on suc- + cess. It returns -1 on error with the global value _e_r_r_n_o set according + to the reason for failure. The error code EAGAIN is overloaded to mean + ``All network ports in use.'' + +SSEEEE AALLSSOO + rlogin(1), rsh(1), intro(2), rexec(3), rexecd(8), rlogind(8), + rshd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/readdir.0 b/usr/share/man/cat3/readdir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/readdir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/realloc.0 b/usr/share/man/cat3/realloc.0 new file mode 100644 index 0000000000..40fe47de80 --- /dev/null +++ b/usr/share/man/cat3/realloc.0 @@ -0,0 +1,35 @@ +REALLOC(3) BSD Programmer's Manual REALLOC(3) + +NNAAMMEE + rreeaalllloocc - reallocation of memory function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d _* + rreeaalllloocc(_v_o_i_d _*_p_t_r, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The rreeaalllloocc() function changes the size of the object pointed to by _p_t_r + to the size specified by _s_i_z_e. The contents of the object are unchanged + up to the lesser of the new and old sizes. If the new size is larger, + the value of the newly allocated portion of the object is indeterminate. + If _p_t_r is a null pointer, the rreeaalllloocc() function behaves like the mal- + loc(3) function for the specified size. Otherwise, if _p_t_r does not match + a pointer earlier returned by the calloc(3), malloc(3), or rreeaalllloocc() + function, or if the space has been deallocated by a call to the free or + rreeaalllloocc() function, unpredictable and usually detrimental behaviour will + occur. If the space cannot be allocated, the object pointed to by _p_t_r is + unchanged. If _s_i_z_e is zero and _p_t_r is not a null pointer, the object it + points to is freed. + + The rreeaalllloocc() function returns either a null pointer or a pointer to the + possibly moved allocated space. + +SSEEEE AALLSSOO + alloca(3), calloc(3), free(3), malloc(3), + +SSTTAANNDDAARRDDSS + The rreeaalllloocc() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/recno.0 b/usr/share/man/cat3/recno.0 new file mode 100644 index 0000000000..7861f41163 --- /dev/null +++ b/usr/share/man/cat3/recno.0 @@ -0,0 +1,198 @@ + + + +RECNO(3) BSD Programmer's Manual RECNO(3) + + +NNAAMMEE + recno - record number database access method + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + +DDEESSCCRRIIPPTTIIOONN + The routine _d_b_o_p_e_n 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 _d_b_o_p_e_n(3), this manual page describes only + the recno specific information. + + 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. + + The recno access method specific data structure provided + to _d_b_o_p_e_n is defined in the include file as fol- + lows: + + typedef struct { + u_long flags; + u_int cachesize; + int psize; + int lorder; + size_t reclen; + u_char bval; + char *bfname; + } RECNOINFO; + + The elements of this structure are defined as follows: + + 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 (``\n'') are used to mark the + end of variable-length records and fixed-length + records are padded with spaces. + + cachesize + A suggested maximum size, in bytes, of the memory + cache. This value is oonnllyy advisory, and the access + method will allocate more memory rather than fail. + If _c_a_c_h_e_s_i_z_e is 0 (no size is specified) a default + + + +4.4 Berkeley Distribution July 19, 1993 1 + + + + + + + + +RECNO(3) BSD Programmer's Manual RECNO(3) + + + cache is used. + + 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 _p_s_i_z_e is 0 (no page size is specified) a + page size is chosen based on the underlying file + system I/O block size. See _b_t_r_e_e(3) for more + information. + + bfname The recno access method stores the in-memory copies + of its records in a btree. If bfname is non-NULL, + it specifies the name of the btree file, as if + specified as the file name for a dbopen of a btree + file. + + flags The flag value is specified by _o_r'ing any of the + following values: + + R_FIXEDLEN + The records are fixed-length, not byte + delimited. The structure element _r_e_c_l_e_n + specifies the length of the record, and the + structure element _b_v_a_l is used as the pad + character. + + R_NOKEY + In the interface specified by _d_b_o_p_e_n, the + sequential record retrieval fills in both + the caller's key and data structures. If + the R_NOKEY flag is specified, the _c_u_r_s_o_r + 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. + + R_SNAPSHOT + This flag requires that a snapshot of the + file be taken when _d_b_o_p_e_n is called, instead + of permitting any unmodified records to be + read from the original file. + + 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 _l_o_r_d_e_r is 0 (no order is + specified) the current host order is used. + + reclen The length of a fixed-length record. + + The data part of the key/data pair used by the recno + + + +4.4 Berkeley Distribution July 19, 1993 2 + + + + + + + + +RECNO(3) BSD Programmer's Manual RECNO(3) + + + access method is the same as other access methods. The + key is different. The _d_a_t_a field of the key should be a + pointer to a memory location of type _r_e_c_n_o___t, as defined + in the include file. This type is normally the + largest unsigned integral type available to the implemen- + tation. The _s_i_z_e field of the key should be the size of + that type. + + In the interface specified by _d_b_o_p_e_n, using the _p_u_t inter- + face 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. + +SSEEEE AALLSSOO + _d_b_o_p_e_n(3), _h_a_s_h(3), _m_p_o_o_l(3), _r_e_c_n_o(3) + + _D_o_c_u_m_e_n_t _P_r_o_c_e_s_s_i_n_g _i_n _a _R_e_l_a_t_i_o_n_a_l _D_a_t_a_b_a_s_e _S_y_s_t_e_m, + Michael Stonebraker, Heidi Stettner, Joseph Kalash, + Antonin Guttman, Nadene Lynn, Memorandum No. UCB/ERL + M82/32, May 1982. + +BBUUGGSS + Only big and little endian byte order is supported. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4.4 Berkeley Distribution July 19, 1993 3 + + + + + diff --git a/usr/share/man/cat3/regex.0 b/usr/share/man/cat3/regex.0 new file mode 100644 index 0000000000..481dcf6dab --- /dev/null +++ b/usr/share/man/cat3/regex.0 @@ -0,0 +1,462 @@ + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + +NNAAMMEE + regcomp, regexec, regerror, regfree - regular-expression + library + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + int regcomp(regex_t *preg, const char *pattern, + int cflags); + + int regexec(const regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); + + size_t regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); + + void regfree(regex_t *preg); + +DDEESSCCRRIIPPTTIIOONN + These routines implement POSIX 1003.2 regular expressions + (``RE''s); see _r_e___f_o_r_m_a_t(7)_. _R_e_g_c_o_m_p compiles an RE writ- + ten as a string into an internal form, _r_e_g_e_x_e_c matches + that internal form against a string and reports results, + _r_e_g_e_r_r_o_r transforms error codes from either into human- + readable messages, and _r_e_g_f_r_e_e frees any dynamically- + allocated storage used by the internal form of an RE. + + The header _<_r_e_g_e_x_._h_> declares two structure types, _r_e_g_e_x___t + and _r_e_g_m_a_t_c_h___t, the former for compiled internal forms and + the latter for match reporting. It also declares the four + functions, a type _r_e_g_o_f_f___t, and a number of constants with + names starting with ``REG_''. + + _R_e_g_c_o_m_p compiles the regular expression contained in the + _p_a_t_t_e_r_n string, subject to the flags in _c_f_l_a_g_s, and places + the results in the _r_e_g_e_x___t structure pointed to by _p_r_e_g. + _C_f_l_a_g_s is the bitwise OR of zero or more of the following + flags: + + REG_EXTENDED Compile modern (``extended'') REs, rather + than the obsolete (``basic'') REs that are + the default. + + REG_BASIC This is a synonym for 0, provided as a coun- + terpart to REG_EXTENDED to improve readabil- + ity. + + REG_NOSPEC Compile with recognition of all special + characters turned off. All characters are + thus considered ordinary, so the ``RE'' is a + + + +4.4BSD June 17, 1993 1 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + literal string. This is an extension, com- + patible with but not specified by POSIX + 1003.2, and should be used with caution in + software intended to be portable to other + systems. REG_EXTENDED and REG_NOSPEC may + not be used in the same call to _r_e_g_c_o_m_p. + + REG_ICASE Compile for matching that ignores + upper/lower case distinctions. See + _r_e___f_o_r_m_a_t(7)_. + + REG_NOSUB Compile for matching that need only report + success or failure, not what was matched. + + REG_NEWLINE Compile for newline-sensitive matching. By + default, newline is a completely ordinary + character with no special meaning in either + REs or strings. With this flag, `[^' + bracket expressions and `.' never match new- + line, a `^' anchor matches the null string + after any newline in the string in addition + to its normal function, and the `$' anchor + matches the null string before any newline + in the string in addition to its normal + function. + + REG_PEND The regular expression ends, not at the + first NUL, but just before the character + pointed to by the _r_e___e_n_d_p member of the + structure pointed to by _p_r_e_g. The _r_e___e_n_d_p + member is of type _c_o_n_s_t _c_h_a_r _*. This flag + permits inclusion of NULs in the RE; they + are considered ordinary characters. This is + an extension, compatible with but not speci- + fied by POSIX 1003.2, and should be used + with caution in software intended to be + portable to other systems. + + When successful, _r_e_g_c_o_m_p returns 0 and fills in the struc- + ture pointed to by _p_r_e_g. One member of that structure + (other than _r_e___e_n_d_p) is publicized: _r_e___n_s_u_b, of type + _s_i_z_e___t, contains the number of parenthesized subexpres- + sions within the RE (except that the value of this member + is undefined if the REG_NOSUB flag was used). If _r_e_g_c_o_m_p + fails, it returns a non-zero error code; see DIAGNOSTICS. + + _R_e_g_e_x_e_c matches the compiled RE pointed to by _p_r_e_g against + the _s_t_r_i_n_g, subject to the flags in _e_f_l_a_g_s, and reports + results using _n_m_a_t_c_h, _p_m_a_t_c_h, and the returned value. The + RE must have been compiled by a previous invocation of + _r_e_g_c_o_m_p. The compiled form is not altered during + + + +4.4BSD June 17, 1993 2 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + execution of _r_e_g_e_x_e_c, so a single compiled RE can be used + simultaneously by multiple threads. + + By default, the NUL-terminated string pointed to by _s_t_r_i_n_g + is considered to be the text of an entire line, minus any + terminating newline. The _e_f_l_a_g_s argument is the bitwise + OR of zero or more of the following flags: + + REG_NOTBOL The first character of the string is not the + beginning of a line, so the `^' anchor + should not match before it. This does not + affect the behavior of newlines under + REG_NEWLINE. + + REG_NOTEOL The NUL terminating the string does not end + a line, so the `$' anchor should not match + before it. This does not affect the behav- + ior of newlines under REG_NEWLINE. + + REG_STARTEND The string is considered to start at + _s_t_r_i_n_g + _p_m_a_t_c_h[0]._r_m___s_o and to have a ter- + minating NUL located at _s_t_r_i_n_g + + _p_m_a_t_c_h[0]._r_m___e_o (there need not actually be + a NUL at that location), regardless of the + value of _n_m_a_t_c_h. See below for the defini- + tion of _p_m_a_t_c_h and _n_m_a_t_c_h. This is an + extension, compatible with but not specified + by POSIX 1003.2, and should be used with + caution in software intended to be portable + to other systems. Note that a non-zero + _r_m___s_o does not imply REG_NOTBOL; + REG_STARTEND affects only the location of + the string, not how it is matched. + + See _r_e___f_o_r_m_a_t(7) for a discussion of what is matched in + situations where an RE or a portion thereof could match + any of several substrings of _s_t_r_i_n_g. + + Normally, _r_e_g_e_x_e_c returns 0 for success and the non-zero + code REG_NOMATCH for failure. Other non-zero error codes + may be returned in exceptional situations; see DIAGNOS- + TICS. + + If REG_NOSUB was specified in the compilation of the RE, + or if _n_m_a_t_c_h is 0, _r_e_g_e_x_e_c ignores the _p_m_a_t_c_h argument + (but see below for the case where REG_STARTEND is speci- + fied). Otherwise, _p_m_a_t_c_h points to an array of _n_m_a_t_c_h + structures of type _r_e_g_m_a_t_c_h___t. Such a structure has at + least the members _r_m___s_o and _r_m___e_o, both of type _r_e_g_o_f_f___t + (a signed arithmetic type at least as large as an _o_f_f___t + and a _s_s_i_z_e___t), containing respectively the offset of the + + + +4.4BSD June 17, 1993 3 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + first character of a substring and the offset of the first + character after the end of the substring. Offsets are + measured from the beginning of the _s_t_r_i_n_g argument given + to _r_e_g_e_x_e_c. An empty substring is denoted by equal off- + sets, both indicating the character following the empty + substring. + + The 0th member of the _p_m_a_t_c_h array is filled in to indi- + cate what substring of _s_t_r_i_n_g was matched by the entire + RE. Remaining members report what substring was matched + by parenthesized subexpressions within the RE; member _i + reports subexpression _i, with subexpressions counted + (starting at 1) by the order of their opening parentheses + in the RE, left to right. Unused entries in the array-- + corresponding either to subexpressions that did not par- + ticipate in the match at all, or to subexpressions that do + not exist in the RE (that is, _i > _p_r_e_g->_r_e___n_s_u_b)--have + both _r_m___s_o and _r_m___e_o set to -1. If a subexpression par- + ticipated in the match several times, the reported sub- + string is the last one it matched. (Note, as an example + in particular, that when the RE `(b*)+' matches `bbb', the + parenthesized subexpression matches each of the three `b's + and then an infinite number of empty strings following the + last `b', so the reported substring is one of the emp- + ties.) + + If REG_STARTEND is specified, _p_m_a_t_c_h must point to at + least one _r_e_g_m_a_t_c_h___t (even if _n_m_a_t_c_h is 0 or REG_NOSUB was + specified), to hold the input offsets for REG_STARTEND. + Use for output is still entirely controlled by _n_m_a_t_c_h; if + _n_m_a_t_c_h is 0 or REG_NOSUB was specified, the value of + _p_m_a_t_c_h[0] will not be changed by a successful _r_e_g_e_x_e_c. + + _R_e_g_e_r_r_o_r maps a non-zero _e_r_r_c_o_d_e from either _r_e_g_c_o_m_p or + _r_e_g_e_x_e_c to a human-readable, printable message. If _p_r_e_g + is non-NULL, the error code should have arisen from use of + the _r_e_g_e_x___t pointed to by _p_r_e_g, and if the error code came + from _r_e_g_c_o_m_p, it should have been the result from the most + recent _r_e_g_c_o_m_p using that _r_e_g_e_x___t. (_R_e_g_e_r_r_o_r may be able + to supply a more detailed message using information from + the _r_e_g_e_x___t.) _R_e_g_e_r_r_o_r places the NUL-terminated message + into the buffer pointed to by _e_r_r_b_u_f, limiting the length + (including the NUL) to at most _e_r_r_b_u_f___s_i_z_e bytes. If the + whole message won't fit, as much of it as will fit before + the terminating NUL is supplied. In any case, the + returned value is the size of buffer needed to hold the + whole message (including terminating NUL). If _e_r_r_b_u_f___s_i_z_e + is 0, _e_r_r_b_u_f is ignored but the return value is still cor- + rect. + + If the _e_r_r_c_o_d_e given to _r_e_g_e_r_r_o_r is first ORed with + + + +4.4BSD June 17, 1993 4 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + REG_ITOA, the ``message'' that results is the printable + name of the error code, e.g. ``REG_NOMATCH'', rather than + an explanation thereof. If _e_r_r_c_o_d_e is REG_ATOI, then _p_r_e_g + shall be non-NULL and the _r_e___e_n_d_p member of the structure + it points to must point to the printable name of an error + code; in this case, the result in _e_r_r_b_u_f is the decimal + digits of the numeric value of the error code (0 if the + name is not recognized). REG_ITOA and REG_ATOI are + intended primarily as debugging facilities; they are + extensions, compatible with but not specified by POSIX + 1003.2, and should be used with caution in software + intended to be portable to other systems. Be warned also + that they are considered experimental and changes are pos- + sible. + + _R_e_g_f_r_e_e frees any dynamically-allocated storage associated + with the compiled RE pointed to by _p_r_e_g. The remaining + _r_e_g_e_x___t is no longer a valid compiled RE and the effect of + supplying it to _r_e_g_e_x_e_c or _r_e_g_e_r_r_o_r is undefined. + + None of these functions references global variables except + for tables of constants; all are safe for use from multi- + ple threads if the arguments are safe. + +IIMMPPLLEEMMEENNTTAATTIIOONN CCHHOOIICCEESS + There are a number of decisions that 1003.2 leaves up to + the implementor, either by explicitly saying ``undefined'' + or by virtue of them being forbidden by the RE grammar. + This implementation treats them as follows. + + See _r_e___f_o_r_m_a_t(7) for a discussion of the definition of + case-independent matching. + + There is no particular limit on the length of REs, except + insofar as memory is limited. Memory usage is approxi- + mately linear in RE size, and largely insensitive to RE + complexity, except for bounded repetitions. See BUGS for + one short RE using them that will run almost any system + out of memory. + + A backslashed character other than one specifically given + a magic meaning by 1003.2 (such magic meanings occur only + in obsolete [``basic''] REs) is taken as an ordinary char- + acter. + + Any unmatched [ is a REG_EBRACK error. + + Equivalence classes cannot begin or end bracket-expression + ranges. The endpoint of one range cannot begin another. + + RE_DUP_MAX, the limit on repetition counts in bounded + + + +4.4BSD June 17, 1993 5 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + repetitions, is 255. + + A repetition operator (?, *, +, or bounds) cannot follow + another repetition operator. A repetition operator cannot + begin an expression or subexpression or follow `^' or `|'. + + `|' cannot appear first or last in a (sub)expression or + after another `|', i.e. an operand of `|' cannot be an + empty subexpression. An empty parenthesized subexpres- + sion, `()', is legal and matches an empty (sub)string. An + empty string is not a legal RE. + + A `{' followed by a digit is considered the beginning of + bounds for a bounded repetition, which must then follow + the syntax for bounds. A `{' _n_o_t followed by a digit is + considered an ordinary character. + + `^' and `$' beginning and ending subexpressions in obso- + lete (``basic'') REs are anchors, not ordinary characters. + +SSEEEE AALLSSOO + grep(1), re_format(7) + + POSIX 1003.2, sections 2.8 (Regular Expression Notation) + and B.5 (C Binding for Regular Expression Matching). + +DDIIAAGGNNOOSSTTIICCSS + Non-zero error codes from _r_e_g_c_o_m_p and _r_e_g_e_x_e_c include the + following: + + REG_NOMATCH regexec() failed to match + REG_BADPAT invalid regular expression + REG_ECOLLATE invalid collating element + REG_ECTYPE invalid character class + REG_EESCAPE \ applied to unescapable character + REG_ESUBREG invalid backreference number + REG_EBRACK brackets [ ] not balanced + REG_EPAREN parentheses ( ) not balanced + REG_EBRACE braces { } not balanced + REG_BADBR invalid repetition count(s) in { } + REG_ERANGE invalid character range in [ ] + REG_ESPACE ran out of memory + REG_BADRPT ?, *, or + operand invalid + REG_EMPTY empty (sub)expression + REG_ASSERT ``can't happen''--you found a bug + REG_INVARG invalid argument, e.g. negative-length string + +HHIISSTTOORRYY + Written by Henry Spencer at University of Toronto, + henry@zoo.toronto.edu. + + + + +4.4BSD June 17, 1993 6 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + +BBUUGGSS + This is an alpha release with known defects. Please + report problems. + + There is one known functionality bug. The implementation + of internationalization is incomplete: the locale is + always assumed to be the default one of 1003.2, and only + the collating elements etc. of that locale are available. + + The back-reference code is subtle and doubts linger about + its correctness in complex cases. + + _R_e_g_e_x_e_c performance is poor. This will improve with later + releases. _N_m_a_t_c_h exceeding 0 is expensive; _n_m_a_t_c_h exceed- + ing 1 is worse. _R_e_g_e_x_e_c is largely insensitive to RE com- + plexity _e_x_c_e_p_t that back references are massively expen- + sive. RE length does matter; in particular, there is a + strong speed bonus for keeping RE length under about 30 + characters, with most special characters counting roughly + double. + + _R_e_g_c_o_m_p implements bounded repetitions by macro expansion, + which is costly in time and space if counts are large or + bounded repetitions are nested. An RE like, say, + `((((a{1,100}){1,100}){1,100}){1,100}){1,100}' will (even- + tually) run almost any existing machine out of swap space. + + There are suspected problems with response to obscure + error conditions. Notably, certain kinds of internal + overflow, produced only by truly enormous REs or by multi- + ply nested bounded repetitions, are probably not handled + well. + + Due to a mistake in 1003.2, things like `a)b' are legal + REs because `)' is a special character only in the pres- + ence of a previous unmatched `('. This can't be fixed + until the spec is fixed. + + The standard's definition of back references is vague. + For example, does `a\(\(b\)*\2\)*d' match `abbbd'? Until + the standard is clarified, behavior in such cases should + not be relied on. + + The implementation of word-boundary matching is a bit of a + kludge, and bugs may lurk in combinations of word-boundary + matching and anchoring. + + + + + + + + +4.4BSD June 17, 1993 7 + + + + + diff --git a/usr/share/man/cat3/regfree.0 b/usr/share/man/cat3/regfree.0 new file mode 100644 index 0000000000..481dcf6dab --- /dev/null +++ b/usr/share/man/cat3/regfree.0 @@ -0,0 +1,462 @@ + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + +NNAAMMEE + regcomp, regexec, regerror, regfree - regular-expression + library + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + int regcomp(regex_t *preg, const char *pattern, + int cflags); + + int regexec(const regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); + + size_t regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); + + void regfree(regex_t *preg); + +DDEESSCCRRIIPPTTIIOONN + These routines implement POSIX 1003.2 regular expressions + (``RE''s); see _r_e___f_o_r_m_a_t(7)_. _R_e_g_c_o_m_p compiles an RE writ- + ten as a string into an internal form, _r_e_g_e_x_e_c matches + that internal form against a string and reports results, + _r_e_g_e_r_r_o_r transforms error codes from either into human- + readable messages, and _r_e_g_f_r_e_e frees any dynamically- + allocated storage used by the internal form of an RE. + + The header _<_r_e_g_e_x_._h_> declares two structure types, _r_e_g_e_x___t + and _r_e_g_m_a_t_c_h___t, the former for compiled internal forms and + the latter for match reporting. It also declares the four + functions, a type _r_e_g_o_f_f___t, and a number of constants with + names starting with ``REG_''. + + _R_e_g_c_o_m_p compiles the regular expression contained in the + _p_a_t_t_e_r_n string, subject to the flags in _c_f_l_a_g_s, and places + the results in the _r_e_g_e_x___t structure pointed to by _p_r_e_g. + _C_f_l_a_g_s is the bitwise OR of zero or more of the following + flags: + + REG_EXTENDED Compile modern (``extended'') REs, rather + than the obsolete (``basic'') REs that are + the default. + + REG_BASIC This is a synonym for 0, provided as a coun- + terpart to REG_EXTENDED to improve readabil- + ity. + + REG_NOSPEC Compile with recognition of all special + characters turned off. All characters are + thus considered ordinary, so the ``RE'' is a + + + +4.4BSD June 17, 1993 1 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + literal string. This is an extension, com- + patible with but not specified by POSIX + 1003.2, and should be used with caution in + software intended to be portable to other + systems. REG_EXTENDED and REG_NOSPEC may + not be used in the same call to _r_e_g_c_o_m_p. + + REG_ICASE Compile for matching that ignores + upper/lower case distinctions. See + _r_e___f_o_r_m_a_t(7)_. + + REG_NOSUB Compile for matching that need only report + success or failure, not what was matched. + + REG_NEWLINE Compile for newline-sensitive matching. By + default, newline is a completely ordinary + character with no special meaning in either + REs or strings. With this flag, `[^' + bracket expressions and `.' never match new- + line, a `^' anchor matches the null string + after any newline in the string in addition + to its normal function, and the `$' anchor + matches the null string before any newline + in the string in addition to its normal + function. + + REG_PEND The regular expression ends, not at the + first NUL, but just before the character + pointed to by the _r_e___e_n_d_p member of the + structure pointed to by _p_r_e_g. The _r_e___e_n_d_p + member is of type _c_o_n_s_t _c_h_a_r _*. This flag + permits inclusion of NULs in the RE; they + are considered ordinary characters. This is + an extension, compatible with but not speci- + fied by POSIX 1003.2, and should be used + with caution in software intended to be + portable to other systems. + + When successful, _r_e_g_c_o_m_p returns 0 and fills in the struc- + ture pointed to by _p_r_e_g. One member of that structure + (other than _r_e___e_n_d_p) is publicized: _r_e___n_s_u_b, of type + _s_i_z_e___t, contains the number of parenthesized subexpres- + sions within the RE (except that the value of this member + is undefined if the REG_NOSUB flag was used). If _r_e_g_c_o_m_p + fails, it returns a non-zero error code; see DIAGNOSTICS. + + _R_e_g_e_x_e_c matches the compiled RE pointed to by _p_r_e_g against + the _s_t_r_i_n_g, subject to the flags in _e_f_l_a_g_s, and reports + results using _n_m_a_t_c_h, _p_m_a_t_c_h, and the returned value. The + RE must have been compiled by a previous invocation of + _r_e_g_c_o_m_p. The compiled form is not altered during + + + +4.4BSD June 17, 1993 2 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + execution of _r_e_g_e_x_e_c, so a single compiled RE can be used + simultaneously by multiple threads. + + By default, the NUL-terminated string pointed to by _s_t_r_i_n_g + is considered to be the text of an entire line, minus any + terminating newline. The _e_f_l_a_g_s argument is the bitwise + OR of zero or more of the following flags: + + REG_NOTBOL The first character of the string is not the + beginning of a line, so the `^' anchor + should not match before it. This does not + affect the behavior of newlines under + REG_NEWLINE. + + REG_NOTEOL The NUL terminating the string does not end + a line, so the `$' anchor should not match + before it. This does not affect the behav- + ior of newlines under REG_NEWLINE. + + REG_STARTEND The string is considered to start at + _s_t_r_i_n_g + _p_m_a_t_c_h[0]._r_m___s_o and to have a ter- + minating NUL located at _s_t_r_i_n_g + + _p_m_a_t_c_h[0]._r_m___e_o (there need not actually be + a NUL at that location), regardless of the + value of _n_m_a_t_c_h. See below for the defini- + tion of _p_m_a_t_c_h and _n_m_a_t_c_h. This is an + extension, compatible with but not specified + by POSIX 1003.2, and should be used with + caution in software intended to be portable + to other systems. Note that a non-zero + _r_m___s_o does not imply REG_NOTBOL; + REG_STARTEND affects only the location of + the string, not how it is matched. + + See _r_e___f_o_r_m_a_t(7) for a discussion of what is matched in + situations where an RE or a portion thereof could match + any of several substrings of _s_t_r_i_n_g. + + Normally, _r_e_g_e_x_e_c returns 0 for success and the non-zero + code REG_NOMATCH for failure. Other non-zero error codes + may be returned in exceptional situations; see DIAGNOS- + TICS. + + If REG_NOSUB was specified in the compilation of the RE, + or if _n_m_a_t_c_h is 0, _r_e_g_e_x_e_c ignores the _p_m_a_t_c_h argument + (but see below for the case where REG_STARTEND is speci- + fied). Otherwise, _p_m_a_t_c_h points to an array of _n_m_a_t_c_h + structures of type _r_e_g_m_a_t_c_h___t. Such a structure has at + least the members _r_m___s_o and _r_m___e_o, both of type _r_e_g_o_f_f___t + (a signed arithmetic type at least as large as an _o_f_f___t + and a _s_s_i_z_e___t), containing respectively the offset of the + + + +4.4BSD June 17, 1993 3 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + first character of a substring and the offset of the first + character after the end of the substring. Offsets are + measured from the beginning of the _s_t_r_i_n_g argument given + to _r_e_g_e_x_e_c. An empty substring is denoted by equal off- + sets, both indicating the character following the empty + substring. + + The 0th member of the _p_m_a_t_c_h array is filled in to indi- + cate what substring of _s_t_r_i_n_g was matched by the entire + RE. Remaining members report what substring was matched + by parenthesized subexpressions within the RE; member _i + reports subexpression _i, with subexpressions counted + (starting at 1) by the order of their opening parentheses + in the RE, left to right. Unused entries in the array-- + corresponding either to subexpressions that did not par- + ticipate in the match at all, or to subexpressions that do + not exist in the RE (that is, _i > _p_r_e_g->_r_e___n_s_u_b)--have + both _r_m___s_o and _r_m___e_o set to -1. If a subexpression par- + ticipated in the match several times, the reported sub- + string is the last one it matched. (Note, as an example + in particular, that when the RE `(b*)+' matches `bbb', the + parenthesized subexpression matches each of the three `b's + and then an infinite number of empty strings following the + last `b', so the reported substring is one of the emp- + ties.) + + If REG_STARTEND is specified, _p_m_a_t_c_h must point to at + least one _r_e_g_m_a_t_c_h___t (even if _n_m_a_t_c_h is 0 or REG_NOSUB was + specified), to hold the input offsets for REG_STARTEND. + Use for output is still entirely controlled by _n_m_a_t_c_h; if + _n_m_a_t_c_h is 0 or REG_NOSUB was specified, the value of + _p_m_a_t_c_h[0] will not be changed by a successful _r_e_g_e_x_e_c. + + _R_e_g_e_r_r_o_r maps a non-zero _e_r_r_c_o_d_e from either _r_e_g_c_o_m_p or + _r_e_g_e_x_e_c to a human-readable, printable message. If _p_r_e_g + is non-NULL, the error code should have arisen from use of + the _r_e_g_e_x___t pointed to by _p_r_e_g, and if the error code came + from _r_e_g_c_o_m_p, it should have been the result from the most + recent _r_e_g_c_o_m_p using that _r_e_g_e_x___t. (_R_e_g_e_r_r_o_r may be able + to supply a more detailed message using information from + the _r_e_g_e_x___t.) _R_e_g_e_r_r_o_r places the NUL-terminated message + into the buffer pointed to by _e_r_r_b_u_f, limiting the length + (including the NUL) to at most _e_r_r_b_u_f___s_i_z_e bytes. If the + whole message won't fit, as much of it as will fit before + the terminating NUL is supplied. In any case, the + returned value is the size of buffer needed to hold the + whole message (including terminating NUL). If _e_r_r_b_u_f___s_i_z_e + is 0, _e_r_r_b_u_f is ignored but the return value is still cor- + rect. + + If the _e_r_r_c_o_d_e given to _r_e_g_e_r_r_o_r is first ORed with + + + +4.4BSD June 17, 1993 4 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + REG_ITOA, the ``message'' that results is the printable + name of the error code, e.g. ``REG_NOMATCH'', rather than + an explanation thereof. If _e_r_r_c_o_d_e is REG_ATOI, then _p_r_e_g + shall be non-NULL and the _r_e___e_n_d_p member of the structure + it points to must point to the printable name of an error + code; in this case, the result in _e_r_r_b_u_f is the decimal + digits of the numeric value of the error code (0 if the + name is not recognized). REG_ITOA and REG_ATOI are + intended primarily as debugging facilities; they are + extensions, compatible with but not specified by POSIX + 1003.2, and should be used with caution in software + intended to be portable to other systems. Be warned also + that they are considered experimental and changes are pos- + sible. + + _R_e_g_f_r_e_e frees any dynamically-allocated storage associated + with the compiled RE pointed to by _p_r_e_g. The remaining + _r_e_g_e_x___t is no longer a valid compiled RE and the effect of + supplying it to _r_e_g_e_x_e_c or _r_e_g_e_r_r_o_r is undefined. + + None of these functions references global variables except + for tables of constants; all are safe for use from multi- + ple threads if the arguments are safe. + +IIMMPPLLEEMMEENNTTAATTIIOONN CCHHOOIICCEESS + There are a number of decisions that 1003.2 leaves up to + the implementor, either by explicitly saying ``undefined'' + or by virtue of them being forbidden by the RE grammar. + This implementation treats them as follows. + + See _r_e___f_o_r_m_a_t(7) for a discussion of the definition of + case-independent matching. + + There is no particular limit on the length of REs, except + insofar as memory is limited. Memory usage is approxi- + mately linear in RE size, and largely insensitive to RE + complexity, except for bounded repetitions. See BUGS for + one short RE using them that will run almost any system + out of memory. + + A backslashed character other than one specifically given + a magic meaning by 1003.2 (such magic meanings occur only + in obsolete [``basic''] REs) is taken as an ordinary char- + acter. + + Any unmatched [ is a REG_EBRACK error. + + Equivalence classes cannot begin or end bracket-expression + ranges. The endpoint of one range cannot begin another. + + RE_DUP_MAX, the limit on repetition counts in bounded + + + +4.4BSD June 17, 1993 5 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + + repetitions, is 255. + + A repetition operator (?, *, +, or bounds) cannot follow + another repetition operator. A repetition operator cannot + begin an expression or subexpression or follow `^' or `|'. + + `|' cannot appear first or last in a (sub)expression or + after another `|', i.e. an operand of `|' cannot be an + empty subexpression. An empty parenthesized subexpres- + sion, `()', is legal and matches an empty (sub)string. An + empty string is not a legal RE. + + A `{' followed by a digit is considered the beginning of + bounds for a bounded repetition, which must then follow + the syntax for bounds. A `{' _n_o_t followed by a digit is + considered an ordinary character. + + `^' and `$' beginning and ending subexpressions in obso- + lete (``basic'') REs are anchors, not ordinary characters. + +SSEEEE AALLSSOO + grep(1), re_format(7) + + POSIX 1003.2, sections 2.8 (Regular Expression Notation) + and B.5 (C Binding for Regular Expression Matching). + +DDIIAAGGNNOOSSTTIICCSS + Non-zero error codes from _r_e_g_c_o_m_p and _r_e_g_e_x_e_c include the + following: + + REG_NOMATCH regexec() failed to match + REG_BADPAT invalid regular expression + REG_ECOLLATE invalid collating element + REG_ECTYPE invalid character class + REG_EESCAPE \ applied to unescapable character + REG_ESUBREG invalid backreference number + REG_EBRACK brackets [ ] not balanced + REG_EPAREN parentheses ( ) not balanced + REG_EBRACE braces { } not balanced + REG_BADBR invalid repetition count(s) in { } + REG_ERANGE invalid character range in [ ] + REG_ESPACE ran out of memory + REG_BADRPT ?, *, or + operand invalid + REG_EMPTY empty (sub)expression + REG_ASSERT ``can't happen''--you found a bug + REG_INVARG invalid argument, e.g. negative-length string + +HHIISSTTOORRYY + Written by Henry Spencer at University of Toronto, + henry@zoo.toronto.edu. + + + + +4.4BSD June 17, 1993 6 + + + + + + + + +REGEX(3) BSD Programmer's Manual REGEX(3) + + +BBUUGGSS + This is an alpha release with known defects. Please + report problems. + + There is one known functionality bug. The implementation + of internationalization is incomplete: the locale is + always assumed to be the default one of 1003.2, and only + the collating elements etc. of that locale are available. + + The back-reference code is subtle and doubts linger about + its correctness in complex cases. + + _R_e_g_e_x_e_c performance is poor. This will improve with later + releases. _N_m_a_t_c_h exceeding 0 is expensive; _n_m_a_t_c_h exceed- + ing 1 is worse. _R_e_g_e_x_e_c is largely insensitive to RE com- + plexity _e_x_c_e_p_t that back references are massively expen- + sive. RE length does matter; in particular, there is a + strong speed bonus for keeping RE length under about 30 + characters, with most special characters counting roughly + double. + + _R_e_g_c_o_m_p implements bounded repetitions by macro expansion, + which is costly in time and space if counts are large or + bounded repetitions are nested. An RE like, say, + `((((a{1,100}){1,100}){1,100}){1,100}){1,100}' will (even- + tually) run almost any existing machine out of swap space. + + There are suspected problems with response to obscure + error conditions. Notably, certain kinds of internal + overflow, produced only by truly enormous REs or by multi- + ply nested bounded repetitions, are probably not handled + well. + + Due to a mistake in 1003.2, things like `a)b' are legal + REs because `)' is a special character only in the pres- + ence of a previous unmatched `('. This can't be fixed + until the spec is fixed. + + The standard's definition of back references is vague. + For example, does `a\(\(b\)*\2\)*d' match `abbbd'? Until + the standard is clarified, behavior in such cases should + not be relied on. + + The implementation of word-boundary matching is a bit of a + kludge, and bugs may lurk in combinations of word-boundary + matching and anchoring. + + + + + + + + +4.4BSD June 17, 1993 7 + + + + + diff --git a/usr/share/man/cat3/remove.0 b/usr/share/man/cat3/remove.0 new file mode 100644 index 0000000000..2b6af6ed23 --- /dev/null +++ b/usr/share/man/cat3/remove.0 @@ -0,0 +1,30 @@ +REMOVE(3) BSD Programmer's Manual REMOVE(3) + +NNAAMMEE + rreemmoovvee - remove directory entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rreemmoovvee(_c_o_n_s_t _c_h_a_r _*_p_a_t_h); + +DDEESSCCRRIIPPTTIIOONN + The rreemmoovvee() function is an alias for the unlink(2) system call. It + deletes the file referenced by _p_a_t_h. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, rreemmoovvee() returns 0. Otherwise, -1 is re- + turned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + The rreemmoovvee() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the routine unlink(2). + +SSEEEE AALLSSOO + unlink(2) + +SSTTAANNDDAARRDDSS + The rreemmoovvee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/res_init.0 b/usr/share/man/cat3/res_init.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/res_init.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/res_mkquery.0 b/usr/share/man/cat3/res_mkquery.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/res_mkquery.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/res_query.0 b/usr/share/man/cat3/res_query.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/res_query.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/res_search.0 b/usr/share/man/cat3/res_search.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/res_search.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/res_send.0 b/usr/share/man/cat3/res_send.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/res_send.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/resolver.0 b/usr/share/man/cat3/resolver.0 new file mode 100644 index 0000000000..3f968c9253 --- /dev/null +++ b/usr/share/man/cat3/resolver.0 @@ -0,0 +1,138 @@ +RESOLVER(3) BSD Programmer's Manual RESOLVER(3) + +NNAAMMEE + rreess__qquueerryy, rreess__sseeaarrcchh, rreess__mmkkqquueerryy, rreess__sseenndd, rreess__iinniitt, ddnn__ccoommpp, + ddnn__eexxppaanndd - resolver routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + rreess__qquueerryy(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__sseeaarrcchh(_c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _u___c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__mmkkqquueerryy(_i_n_t _o_p, _c_h_a_r _*_d_n_a_m_e, _i_n_t _c_l_a_s_s, _i_n_t _t_y_p_e, _c_h_a_r _*_d_a_t_a, + _i_n_t _d_a_t_a_l_e_n, _s_t_r_u_c_t _r_r_e_c _*_n_e_w_r_r, _c_h_a_r _*_b_u_f, _i_n_t _b_u_f_l_e_n); + + rreess__sseenndd(_c_h_a_r _*_m_s_g, _i_n_t _m_s_g_l_e_n, _c_h_a_r _*_a_n_s_w_e_r, _i_n_t _a_n_s_l_e_n); + + rreess__iinniitt(); + + ddnn__ccoommpp(_c_h_a_r _*_e_x_p___d_n, _c_h_a_r _*_c_o_m_p___d_n, _i_n_t _l_e_n_g_t_h, _c_h_a_r _*_*_d_n_p_t_r_s, + _c_h_a_r _*_*_l_a_s_t_d_n_p_t_r); + + ddnn__eexxppaanndd(_u___c_h_a_r _*_m_s_g, _u___c_h_a_r _*_e_o_m_o_r_i_g, _u___c_h_a_r _*_c_o_m_p___d_n, _u___c_h_a_r _*_e_x_p___d_n, + _i_n_t _l_e_n_g_t_h); + +DDEESSCCRRIIPPTTIIOONN + These routines are used for making, sending and interpreting query and + reply messages with Internet domain name servers. + + Global configuration and state information that is used by the resolver + routines is kept in the structure ___r_e_s. Most of the values have reason- + able defaults and can be ignored. Options stored in ___r_e_s_._o_p_t_i_o_n_s are de- + fined in _r_e_s_o_l_v_._h and are as follows. Options are stored as a simple bit + mask containing the bitwise ``or'' of the options enabled. + + RES_INIT True if the initial name server address and default domain + name are initialized (i.e., rreess__iinniitt() has been called). + + RES_DEBUG Print debugging messages. + + RES_AAONLY Accept authoritative answers only. With this option, + rreess__sseenndd() should continue until it finds an authoritative + answer or finds an error. Currently this is not implement- + ed. + + RES_USEVC Use TCP connections for queries instead of UDP datagrams. + + RES_STAYOPEN Used with RES_USEVC to keep the TCP connection open between + queries. This is useful only in programs that regularly do + many queries. UDP should be the normal mode used. + + RES_IGNTC Unused currently (ignore truncation errors, i.e., don't + retry with TCP). + + RES_RECURSE Set the recursion-desired bit in queries. This is the de- + fault. (rreess__sseenndd() does not do iterative queries and ex- + pects the name server to handle recursion.) + + RES_DEFNAMES If set, rreess__sseeaarrcchh() will append the default domain name to + single-component names (those that do not contain a dot). + + This option is enabled by default. + + RES_DNSRCH If this option is set, rreess__sseeaarrcchh() will search for host + names in the current domain and in parent domains; see + hostname(7). This is used by the standard host lookup rou- + tine gethostbyname(3). This option is enabled by default. + + The rreess__iinniitt() routine reads the configuration file (if any; see + resolver(5)) to get the default domain name, search list and the Inter- + net address of the local name server(s). If no server is configured, the + host running the resolver is tried. The current domain name is defined + by the hostname if not specified in the configuration file; it can be + overridden by the environment variable LOCALDOMAIN. Initialization nor- + mally occurs on the first call to one of the following routines. + + The rreess__qquueerryy() function provides an interface to the server query mecha- + nism. It constructs a query, sends it to the local server, awaits a re- + sponse, and makes preliminary checks on the reply. The query requests + information of the specified _t_y_p_e and _c_l_a_s_s for the specified fully- + qualified domain name _d_n_a_m_e. The reply message is left in the _a_n_s_w_e_r + buffer with length _a_n_s_l_e_n supplied by the caller. + + The rreess__sseeaarrcchh() routine makes a query and awaits a response like + rreess__qquueerryy(), but in addition, it implements the default and search rules + controlled by the RES_DEFNAMES and RES_DNSRCH options. It returns the + first successful reply. + + The remaining routines are lower-level routines used by rreess__qquueerryy(). The + rreess__mmkkqquueerryy() function constructs a standard query message and places it + in _b_u_f. It returns the size of the query, or -1 if the query is larger + than _b_u_f_l_e_n. The query type _o_p is usually QUERY, but can be any of the + query types defined in <_a_r_p_a_/_n_a_m_e_s_e_r_._h>. The domain name for the query is + given by _d_n_a_m_e. _N_e_w_r_r is currently unused but is intended for making up- + date messages. + + The rreess__sseenndd() routine sends a pre-formatted query and returns an answer. + It will call rreess__iinniitt() if RES_INIT is not set, send the query to the lo- + cal name server, and handle timeouts and retries. The length of the re- + ply message is returned, or -1 if there were errors. + + The ddnn__ccoommpp() function compresses the domain name _e_x_p___d_n and stores it in + _c_o_m_p___d_n. The size of the compressed name is returned or -1 if there were + errors. The size of the array pointed to by _c_o_m_p___d_n is given by _l_e_n_g_t_h. + The compression uses an array of pointers _d_n_p_t_r_s to previously-compressed + names in the current message. The first pointer points to to the begin- + ning of the message and the list ends with NULL. The limit to the array + is specified by _l_a_s_t_d_n_p_t_r. A side effect of ddnn__ccoommpp() is to update the + list of pointers for labels inserted into the message as the name is com- + pressed. If _d_n_p_t_r is NULL, names are not compressed. If _l_a_s_t_d_n_p_t_r is + NULL, the list of labels is not updated. + + The ddnn__eexxppaanndd() entry expands the compressed domain name _c_o_m_p___d_n to a + full domain name The compressed name is contained in a query or reply + message; _m_s_g is a pointer to the beginning of the message. The uncom- + pressed name is placed in the buffer indicated by _e_x_p___d_n which is of size + _l_e_n_g_t_h. The size of compressed name is returned or -1 if there was an er- + ror. + +FFIILLEESS + /etc/resolv.conf The configuration file see resolver(5). + +SSEEEE AALLSSOO + gethostbyname(3), named(8), resolver(5), hostname(7), + + _R_F_C_1_0_3_2, _R_F_C_1_0_3_3, _R_F_C_1_0_3_4, _R_F_C_1_0_3_5, _R_F_C_9_7_4 + + + _N_a_m_e _S_e_r_v_e_r _O_p_e_r_a_t_i_o_n_s _G_u_i_d_e _f_o_r _B_I_N_D. + +HHIISSTTOORRYY + The rreess__qquueerryy function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/rewind.0 b/usr/share/man/cat3/rewind.0 new file mode 100644 index 0000000000..bd82b24936 --- /dev/null +++ b/usr/share/man/cat3/rewind.0 @@ -0,0 +1,75 @@ +FSEEK(3) BSD Programmer's Manual FSEEK(3) + +NNAAMMEE + ffggeettppooss, ffsseeeekk, ffsseettppooss, fftteellll, rreewwiinndd - reposition a stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ffsseeeekk(_F_I_L_E _*_s_t_r_e_a_m, _l_o_n_g _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e); + + _l_o_n_g + fftteellll(_F_I_L_E _*_s_t_r_e_a_m); + + _v_o_i_d + rreewwiinndd(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffggeettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + + _i_n_t + ffsseettppooss(_F_I_L_E _*_s_t_r_e_a_m, _f_p_o_s___t _*_p_o_s); + +DDEESSCCRRIIPPTTIIOONN + The ffsseeeekk() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m. The new position, measured in bytes, is obtained by + adding _o_f_f_s_e_t bytes to the position specified by _w_h_e_n_c_e. If _w_h_e_n_c_e is set + to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start + of the file, the current position indicator, or end-of-file, respective- + ly. A successful call to the ffsseeeekk() function clears the end-of-file in- + dicator for the stream and undoes any effects of the ungetc(3) function + on the same stream. + + The fftteellll() function obtains the current value of the file position indi- + cator for the stream pointed to by _s_t_r_e_a_m. + + The rreewwiinndd() function sets the file position indicator for the stream + pointed to by _s_t_r_e_a_m to the beginning of the file. It is equivalent to: + + (void)fseek(stream, 0L, SEEK_SET) + + except that the error indicator for the stream is also cleared (see + clearerr(3)). + + The ffggeettppooss() and ffsseettppooss() functions are alternate interfaces equivalent + to fftteellll() and ffsseeeekk() (with whence set to SEEK_SET ), setting and stor- + ing the current value of the file offset into or from the object refer- + enced by _p_o_s. On some (non-UNIX) systems an ``_f_p_o_s___t'' object may be a + complex object and these routines may be the only way to portably reposi- + tion a text stream. + +RREETTUURRNN VVAALLUUEESS + The rreewwiinndd() function returns no value. Upon successful completion, + ffggeettppooss(), ffsseeeekk(), ffsseettppooss() return 0, and fftteellll() returns the current + offset. Otherwise, -1 is returned and the global variable errno is set + to indicate the error. + +EERRRROORRSS + [EBADF] The _s_t_r_e_a_m specified is not a seekable stream. + + [EINVAL] The _w_h_e_n_c_e argument to ffsseeeekk() was not SEEK_SET, SEEK_END, or + SEEK_CUR. + + The function ffggeettppooss(), ffsseeeekk(), ffsseettppooss(), and fftteellll() may also fail and + set _e_r_r_n_o for any of the errors specified for the routines fflush(3), + fstat(2), lseek(2), and malloc(3). + +SSEEEE AALLSSOO + lseek(2) + +SSTTAANNDDAARRDDSS + The ffggeettppooss(), ffsseettppooss(), ffsseeeekk(), fftteellll(), and rreewwiinndd() functions con- + form to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/rewinddir.0 b/usr/share/man/cat3/rewinddir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/rewinddir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/rindex.0 b/usr/share/man/cat3/rindex.0 new file mode 100644 index 0000000000..8252d5f832 --- /dev/null +++ b/usr/share/man/cat3/rindex.0 @@ -0,0 +1,27 @@ +RINDEX(3) BSD Programmer's Manual RINDEX(3) + +NNAAMMEE + rriinnddeexx - locate character in string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + rriinnddeexx(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The rriinnddeexx() function locates the last character matching _c (converted to + a _c_h_a_r) in the null-terminated string _s. + +RREETTUURRNN VVAALLUUEESS + A pointer to the character is returned if it is found; otherwise NULL is + returned. If _c is `\0', rriinnddeexx() locates the terminating `\0'. + +SSEEEE AALLSSOO + index(3), memchr(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +HHIISSTTOORRYY + A rriinnddeexx() function appeared in Version 6 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/rresvport.0 b/usr/share/man/cat3/rresvport.0 new file mode 100644 index 0000000000..446362aca7 --- /dev/null +++ b/usr/share/man/cat3/rresvport.0 @@ -0,0 +1,96 @@ +RCMD(3) BSD Programmer's Manual RCMD(3) + +NNAAMMEE + rrccmmdd, rrrreessvvppoorrtt, rruusseerrookk - routines for returning a stream to a remote + command + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rrccmmdd(_c_h_a_r _*_*_a_h_o_s_t, _i_n_t _i_n_p_o_r_t, _c_o_n_s_t _c_h_a_r _*_l_o_c_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_e_m_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_c_m_d, _i_n_t _*_f_d_2_p); + + _i_n_t + rrrreessvvppoorrtt(_i_n_t _*_p_o_r_t); + + _i_n_t + iirruusseerrookk(_u___l_o_n_g _r_a_d_d_r, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + + _i_n_t + rruusseerrookk(_c_o_n_s_t _c_h_a_r _*_r_h_o_s_t, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + +DDEESSCCRRIIPPTTIIOONN + The rrccmmdd() function is used by the super-user to execute a command on a + remote machine using an authentication scheme based on reserved port num- + bers. The rrrreessvvppoorrtt() function returns a descriptor to a socket with an + address in the privileged port space. The rruusseerrookk() function is used by + servers to authenticate clients requesting service with rrccmmdd(). All + three functions are present in the same file and are used by the rshd(8) + server (among others). + + The rrccmmdd() function looks up the host _*_a_h_o_s_t using gethostbyname(3), re- + turning -1 if the host does not exist. Otherwise _*_a_h_o_s_t is set to the + standard name of the host and a connection is established to a server re- + siding at the well-known Internet port _i_n_p_o_r_t. + + If the connection succeeds, a socket in the Internet domain of type + SOCK_STREAM is returned to the caller, and given to the remote command as + _s_t_d_i_n and _s_t_d_o_u_t. If _f_d_2_p is non-zero, then an auxiliary channel to a + control process will be set up, and a descriptor for it will be placed in + _*_f_d_2_p. 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 _f_d_2_p is 0, then the _s_t_d_e_r_r (unit 2 of the remote command) + will be made the same as the _s_t_d_o_u_t 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. + + The protocol is described in detail in rshd(8). + + The rrrreessvvppoorrtt() function is used to obtain a socket with a privileged ad- + dress bound to it. This socket is suitable for use by rrccmmdd() and several + other functions. Privileged Internet ports are those in the range 0 to + 1023. Only the super-user is allowed to bind an address of this sort to + a socket. + + The iirruusseerrookk() and rruusseerrookk() functions take a remote host's IP address or + name, as returned by the gethostbyname(3) routines, two user names and a + flag indicating whether the local user's name is that of the super-user. + Then, if the user is _N_O_T the super-user, it checks the _/_e_t_c_/_h_o_s_t_s_._e_q_u_i_v + file. If that lookup is not done, or is unsuccessful, the _._r_h_o_s_t_s in the + local user's home directory is checked to see if the request for service + is allowed. + + If this file does not exist, is not a regular file, is owned by anyone + other than the user or the super-user, or is writeable by anyone other + than the owner, the check automatically fails. Zero is returned if the + machine name is listed in the ``_h_o_s_t_s_._e_q_u_i_v'' file, or the host and re- + mote user name are found in the ``_._r_h_o_s_t_s'' file; otherwise iirruusseerrookk() + and rruusseerrookk() return -1. If the local domain (as obtained from + gethostname(2)) is the same as the remote domain, only the machine name + need be specified. + + The iirruusseerrookk() function is strongly preferred for security reasons. It + requires trusting the local DNS at most, while the rruusseerrookk() function re- + quires trusting the entire DNS, which can be spoofed. + +DDIIAAGGNNOOSSTTIICCSS + The rrccmmdd() function returns a valid socket descriptor on success. It re- + turns -1 on error and prints a diagnostic message on the standard error. + + The rrrreessvvppoorrtt() function returns a valid, bound socket descriptor on suc- + cess. It returns -1 on error with the global value _e_r_r_n_o set according + to the reason for failure. The error code EAGAIN is overloaded to mean + ``All network ports in use.'' + +SSEEEE AALLSSOO + rlogin(1), rsh(1), intro(2), rexec(3), rexecd(8), rlogind(8), + rshd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/rune.0 b/usr/share/man/cat3/rune.0 new file mode 100644 index 0000000000..805dbc89cc --- /dev/null +++ b/usr/share/man/cat3/rune.0 @@ -0,0 +1,116 @@ +RUNE(3) BSD Programmer's Manual RUNE(3) + +NNAAMMEE + sseettrruunneellooccaallee, sseettiinnvvaalliiddrruunnee, ssggeettrruunnee, ssppuuttrruunnee - rune support for C + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + sseettrruunneellooccaallee(_c_h_a_r _*_l_o_c_a_l_e); + + _v_o_i_d + sseettiinnvvaalliiddrruunnee(_r_u_n_e___t _r_u_n_e); + + _r_u_n_e___t + ssggeettrruunnee(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g, _s_i_z_e___t _n, _c_h_a_r _c_o_n_s_t _*_*_r_e_s_u_l_t); + + _i_n_t + ssppuuttrruunnee(_r_u_n_e___t _r_u_n_e, _c_h_a_r _*_s_t_r_i_n_g, _s_i_z_e___t _n, _c_h_a_r _*_*_r_e_s_u_l_t); + + + ##iinncclluuddee <> + + _l_o_n_g + ffggeettrruunnee(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffuunnggeettrruunnee(_r_u_n_e___t _r_u_n_e, _F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + ffppuuttrruunnee(_r_u_n_e___t _r_u_n_e, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The sseettrruunneellooccaallee() controls the type of encoding used to represent runes + as multibyte strings as well as the properties of the runes as defined in + <>. The _l_o_c_a_l_e argument indicates the locale which to load. If + the locale is successfully loaded, 0 is returned, otherwise an errno val- + ue is returned to indicate the type of error. + + The sseettiinnvvaalliiddrruunnee() function sets the value of the global value + _INVALID_RUNE to be _r_u_n_e_. + + The ssggeettrruunnee() function tries to read a single multibyte character from + _s_t_r_i_n_g, which is at most _n bytes long. If ssggeettrruunnee() is successful, the + rune is returned. If _r_e_s_u_l_t is not NULL, _*_r_e_s_u_l_t will point to the first + byte which was not converted in _s_t_r_i_n_g_. If the first _n bytes of _s_t_r_i_n_g do + not describe a full multibyte character, _INVALID_RUNE is returned and + _*_r_e_s_u_l_t will point to _s_t_r_i_n_g_. If there is an encoding error at the start + of _s_t_r_i_n_g, _INVALID_RUNE is returned and _*_r_e_s_u_l_t will point to the second + character of _s_t_r_i_n_g_. + + the ssppuuttrruunnee() function tries to encode _r_u_n_e as a multibyte string and + store it at _s_t_r_i_n_g, but no more than _n bytes will be stored. If _r_e_s_u_l_t + is not NULL, _*_r_e_s_u_l_t will be set to point to the first byte in string + following the new multibyte character. If _s_t_r_i_n_g is NULL, _*_r_e_s_u_l_t will + point to (char *)0 + _x, where _x is the number of bytes that would be + needed to store the multibyte value. If the multibyte character would + consist of more than _n bytes and _r_e_s_u_l_t is not NULL, _*_r_e_s_u_l_t will be set + to NULL. In all cases, ssppuuttrruunnee() will return the number of bytes which + would be needed to store _r_u_n_e as a multibyte character. + + The ffggeettrruunnee() function operates the same as ssggeettrruunnee() with the excep- + tion that it attempts to read enough bytes from _s_t_r_e_a_m to decode a single + rune. It returns either EOF on end of file, _INVALID_RUNE on an encoding + error, or the rune decoded if all went well. + + The ffuunnggeettrruunnee() function function pushes the multibyte encoding, as pro- + vided by ssppuuttrruunnee(), of _r_u_n_e onto _s_t_r_e_a_m such that the next ffggeettrruunnee() + call will return _r_u_n_e. It returns EOF if it fails and 0 on success. + + The ffppuuttrruunnee() function writes the multibyte encoding of _r_u_n_e, as provid- + ed by ssppuuttrruunnee(), onto _s_t_r_e_a_m. It returns EOF on failure and 0 on suc- + cess. + +RREETTUURRNN VVAALLUUEESS + The sseettrruunneellooccaallee() function returns one of the following values: + + 0 _s_e_t_r_u_n_e_l_o_c_a_l_e _w_a_s _s_u_c_c_e_s_s_f_u_l_. + + EFAULT _l_o_c_a_l_e was NULL. + + ENOENT The locale could not be found. + + EFTYPE The file found was not a valid file. + + EINVAL The encoding indicated by the locale was unknown. + + The ssggeettrruunnee() function either returns the rune read or _INVALID_RUNE. + The ssppuuttrruunnee() function returns the number of bytes needed to store _r_u_n_e + as a multibyte string. + +FFIILLEESS + $PATH_LOCALE/_l_o_c_a_l_e/LC_CTYPE + /usr/share/locale/_l_o_c_a_l_e/LC_CTYPE binary LC_CTYPE file for the locale + _l_o_c_a_l_e. + +SSEEEE AALLSSOO + euc(4), mbrune(3), setlocale(3), utf2(4) + +NNOOTTEE + The ANSI C type wchar_t is the same as rune_t. Rune_t was chosen to ac- + cent the purposeful choice of not basing the system with the ANSI C prim- + itives, which were, shall we say, less aesthetic. + +HHIISSTTOORRYY + These functions first appeared in 4.4BSD. + + The sseettrruunneellooccaallee() function and the other non-ANSI rune functions were + inspired by PPllaann 99 ffrroomm BBeellll LLaabbss as a much more sane alternative to the + ANSI multibyte and wide character support. + + All of the ANSI multibyte and wide character support functions are built + using the rune functions. + +4.4BSD June 27, 1993 2 diff --git a/usr/share/man/cat3/ruserok.0 b/usr/share/man/cat3/ruserok.0 new file mode 100644 index 0000000000..446362aca7 --- /dev/null +++ b/usr/share/man/cat3/ruserok.0 @@ -0,0 +1,96 @@ +RCMD(3) BSD Programmer's Manual RCMD(3) + +NNAAMMEE + rrccmmdd, rrrreessvvppoorrtt, rruusseerrookk - routines for returning a stream to a remote + command + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + rrccmmdd(_c_h_a_r _*_*_a_h_o_s_t, _i_n_t _i_n_p_o_r_t, _c_o_n_s_t _c_h_a_r _*_l_o_c_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_e_m_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_c_m_d, _i_n_t _*_f_d_2_p); + + _i_n_t + rrrreessvvppoorrtt(_i_n_t _*_p_o_r_t); + + _i_n_t + iirruusseerrookk(_u___l_o_n_g _r_a_d_d_r, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + + _i_n_t + rruusseerrookk(_c_o_n_s_t _c_h_a_r _*_r_h_o_s_t, _i_n_t _s_u_p_e_r_u_s_e_r, _c_o_n_s_t _c_h_a_r _*_r_u_s_e_r, + _c_o_n_s_t _c_h_a_r _*_l_u_s_e_r); + +DDEESSCCRRIIPPTTIIOONN + The rrccmmdd() function is used by the super-user to execute a command on a + remote machine using an authentication scheme based on reserved port num- + bers. The rrrreessvvppoorrtt() function returns a descriptor to a socket with an + address in the privileged port space. The rruusseerrookk() function is used by + servers to authenticate clients requesting service with rrccmmdd(). All + three functions are present in the same file and are used by the rshd(8) + server (among others). + + The rrccmmdd() function looks up the host _*_a_h_o_s_t using gethostbyname(3), re- + turning -1 if the host does not exist. Otherwise _*_a_h_o_s_t is set to the + standard name of the host and a connection is established to a server re- + siding at the well-known Internet port _i_n_p_o_r_t. + + If the connection succeeds, a socket in the Internet domain of type + SOCK_STREAM is returned to the caller, and given to the remote command as + _s_t_d_i_n and _s_t_d_o_u_t. If _f_d_2_p is non-zero, then an auxiliary channel to a + control process will be set up, and a descriptor for it will be placed in + _*_f_d_2_p. 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 _f_d_2_p is 0, then the _s_t_d_e_r_r (unit 2 of the remote command) + will be made the same as the _s_t_d_o_u_t 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. + + The protocol is described in detail in rshd(8). + + The rrrreessvvppoorrtt() function is used to obtain a socket with a privileged ad- + dress bound to it. This socket is suitable for use by rrccmmdd() and several + other functions. Privileged Internet ports are those in the range 0 to + 1023. Only the super-user is allowed to bind an address of this sort to + a socket. + + The iirruusseerrookk() and rruusseerrookk() functions take a remote host's IP address or + name, as returned by the gethostbyname(3) routines, two user names and a + flag indicating whether the local user's name is that of the super-user. + Then, if the user is _N_O_T the super-user, it checks the _/_e_t_c_/_h_o_s_t_s_._e_q_u_i_v + file. If that lookup is not done, or is unsuccessful, the _._r_h_o_s_t_s in the + local user's home directory is checked to see if the request for service + is allowed. + + If this file does not exist, is not a regular file, is owned by anyone + other than the user or the super-user, or is writeable by anyone other + than the owner, the check automatically fails. Zero is returned if the + machine name is listed in the ``_h_o_s_t_s_._e_q_u_i_v'' file, or the host and re- + mote user name are found in the ``_._r_h_o_s_t_s'' file; otherwise iirruusseerrookk() + and rruusseerrookk() return -1. If the local domain (as obtained from + gethostname(2)) is the same as the remote domain, only the machine name + need be specified. + + The iirruusseerrookk() function is strongly preferred for security reasons. It + requires trusting the local DNS at most, while the rruusseerrookk() function re- + quires trusting the entire DNS, which can be spoofed. + +DDIIAAGGNNOOSSTTIICCSS + The rrccmmdd() function returns a valid socket descriptor on success. It re- + turns -1 on error and prints a diagnostic message on the standard error. + + The rrrreessvvppoorrtt() function returns a valid, bound socket descriptor on suc- + cess. It returns -1 on error with the global value _e_r_r_n_o set according + to the reason for failure. The error code EAGAIN is overloaded to mean + ``All network ports in use.'' + +SSEEEE AALLSSOO + rlogin(1), rsh(1), intro(2), rexec(3), rexecd(8), rlogind(8), + rshd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/scandir.0 b/usr/share/man/cat3/scandir.0 new file mode 100644 index 0000000000..c0281fb82d --- /dev/null +++ b/usr/share/man/cat3/scandir.0 @@ -0,0 +1,51 @@ +SCANDIR(3) BSD Programmer's Manual SCANDIR(3) + +NNAAMMEE + ssccaannddiirr, aallpphhaassoorrtt - scan a directory + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ssccaannddiirr(_c_o_n_s_t _c_h_a_r _*_d_i_r_n_a_m_e, _s_t_r_u_c_t _d_i_r_e_n_t _*_*_*_n_a_m_e_l_i_s_t, + _i_n_t (_*_s_e_l_e_c_t)(_s_t_r_u_c_t _d_i_r_e_n_t _*), + _i_n_t (_*_c_o_m_p_a_r)(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*)); + + _i_n_t + aallpphhaassoorrtt(_c_o_n_s_t _v_o_i_d _*_d_1, _c_o_n_s_t _v_o_i_d _*_d_2); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannddiirr() function reads the directory _d_i_r_n_a_m_e and builds an array of + pointers to directory entries using malloc(3). It returns the number of + entries in the array. A pointer to the array of directory entries is + stored in the location referenced by _n_a_m_e_l_i_s_t. + + The _s_e_l_e_c_t parameter is a pointer to a user supplied subroutine which is + called by ssccaannddiirr() to select which entries are to be included in the ar- + ray. The select routine is passed a pointer to a directory entry and + should return a non-zero value if the directory entry is to be included + in the array. If _s_e_l_e_c_t is null, then all the directory entries will be + included. + + The _c_o_m_p_a_r parameter is a pointer to a user supplied subroutine which is + passed to qsort(3) to sort the completed array. If this pointer is null, + the array is not sorted. + + The aallpphhaassoorrtt() function is a routine which can be used for the _c_o_m_p_a_r + parameter to sort the array alphabetically. + + The memory allocated for the array can be deallocated with free(3), by + freeing each pointer in the array and then the array itself. + +DDIIAAGGNNOOSSTTIICCSS + Returns -1 if the directory cannot be opened for reading or if malloc(3) + cannot allocate enough memory to hold all the data structures. + +SSEEEE AALLSSOO + directory(3), malloc(3), qsort(3), dir(5) + +HHIISSTTOORRYY + The ssccaannddiirr() and aallpphhaassoorrtt() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/scanf.0 b/usr/share/man/cat3/scanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/scanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/seekdir.0 b/usr/share/man/cat3/seekdir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/seekdir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setbuf.0 b/usr/share/man/cat3/setbuf.0 new file mode 100644 index 0000000000..d43a301bed --- /dev/null +++ b/usr/share/man/cat3/setbuf.0 @@ -0,0 +1,91 @@ +SETBUF(3) BSD Programmer's Manual SETBUF(3) + +NNAAMMEE + sseettbbuuff, sseettbbuuffffeerr, sseettlliinneebbuuff, sseettvvbbuuff - stream buffering operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + sseettbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f); + + _v_o_i_d + sseettbbuuffffeerr(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _s_i_z_e___t _s_i_z_e); + + _i_n_t + sseettlliinneebbuuff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + sseettvvbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _i_n_t _m_o_d_e, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The three types of buffering available are unbuffered, block buffered, + and line buffered. When an output stream is unbuffered, information ap- + pears 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 + stdin). The function fflush(3) may be used to force the block out early. + (See fclose(3).) + + Normally all files are block buffered. When the first I/O operation oc- + curs on a file, malloc(3) is called, and an optimally-sized buffer is ob- + tained. If a stream refers to a terminal (as _s_t_d_o_u_t normally does) it is + line buffered. The standard error stream _s_t_d_e_r_r is always unbuffered. + + The sseettvvbbuuff() function may be used to alter the buffering behavior of a + stream. The _m_o_d_e parameter must be one of the following three macros: + + _IONBF unbuffered + + _IOLBF line buffered + + _IOFBF fully buffered + + The _s_i_z_e parameter may be given as zero to obtain deferred optimal-size + buffer allocation as usual. If it is not zero, then except for un- + buffered files, the _b_u_f argument should point to a buffer at least _s_i_z_e + bytes long; this buffer will be used instead of the current buffer. (If + the _s_i_z_e argument is not zero but _b_u_f is NULL, a buffer of the given size + will be allocated immediately, and released on close. This is an exten- + sion to ANSI C; portable code should use a size of 0 with any NULL + buffer.) + + The sseettvvbbuuff() function may be used at any time, but may have peculiar + side effects (such as discarding input or flushing output) if the stream + is ``active''. Portable applications should call it only once on any + given stream, and before any I/O is performed. + + The other three calls are, in effect, simply aliases for calls to + sseettvvbbuuff(). Except for the lack of a return value, the sseettbbuuff() function + is exactly equivalent to the call + + setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + + + The sseettbbuuffffeerr() function is the same, except that the size of the buffer + is up to the caller, rather than being determined by the default BUFSIZ. + The sseettlliinneebbuuff() function is exactly equivalent to the call: + + setvbuf(stream, (char *)NULL, _IOLBF, 0); + +RREETTUURRNN VVAALLUUEESS + The sseettvvbbuuff() function returns 0 on success, or EOF if the request cannot + be honored (note that the stream is still functional in this case). + + The sseettlliinneebbuuff() function returns what the equivalent sseettvvbbuuff() would + have returned. + +SSEEEE AALLSSOO + fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3) + +SSTTAANNDDAARRDDSS + The sseettbbuuff() and sseettvvbbuuff() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + The sseettbbuuffffeerr() and sseettlliinneebbuuff() functions are not portable to versions + of BSD before 4.2BSD. On 4.2BSD and 4.3BSD systems, sseettbbuuff() always uses + a suboptimal buffer size and should be avoided. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setbuffer.0 b/usr/share/man/cat3/setbuffer.0 new file mode 100644 index 0000000000..d43a301bed --- /dev/null +++ b/usr/share/man/cat3/setbuffer.0 @@ -0,0 +1,91 @@ +SETBUF(3) BSD Programmer's Manual SETBUF(3) + +NNAAMMEE + sseettbbuuff, sseettbbuuffffeerr, sseettlliinneebbuuff, sseettvvbbuuff - stream buffering operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + sseettbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f); + + _v_o_i_d + sseettbbuuffffeerr(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _s_i_z_e___t _s_i_z_e); + + _i_n_t + sseettlliinneebbuuff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + sseettvvbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _i_n_t _m_o_d_e, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The three types of buffering available are unbuffered, block buffered, + and line buffered. When an output stream is unbuffered, information ap- + pears 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 + stdin). The function fflush(3) may be used to force the block out early. + (See fclose(3).) + + Normally all files are block buffered. When the first I/O operation oc- + curs on a file, malloc(3) is called, and an optimally-sized buffer is ob- + tained. If a stream refers to a terminal (as _s_t_d_o_u_t normally does) it is + line buffered. The standard error stream _s_t_d_e_r_r is always unbuffered. + + The sseettvvbbuuff() function may be used to alter the buffering behavior of a + stream. The _m_o_d_e parameter must be one of the following three macros: + + _IONBF unbuffered + + _IOLBF line buffered + + _IOFBF fully buffered + + The _s_i_z_e parameter may be given as zero to obtain deferred optimal-size + buffer allocation as usual. If it is not zero, then except for un- + buffered files, the _b_u_f argument should point to a buffer at least _s_i_z_e + bytes long; this buffer will be used instead of the current buffer. (If + the _s_i_z_e argument is not zero but _b_u_f is NULL, a buffer of the given size + will be allocated immediately, and released on close. This is an exten- + sion to ANSI C; portable code should use a size of 0 with any NULL + buffer.) + + The sseettvvbbuuff() function may be used at any time, but may have peculiar + side effects (such as discarding input or flushing output) if the stream + is ``active''. Portable applications should call it only once on any + given stream, and before any I/O is performed. + + The other three calls are, in effect, simply aliases for calls to + sseettvvbbuuff(). Except for the lack of a return value, the sseettbbuuff() function + is exactly equivalent to the call + + setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + + + The sseettbbuuffffeerr() function is the same, except that the size of the buffer + is up to the caller, rather than being determined by the default BUFSIZ. + The sseettlliinneebbuuff() function is exactly equivalent to the call: + + setvbuf(stream, (char *)NULL, _IOLBF, 0); + +RREETTUURRNN VVAALLUUEESS + The sseettvvbbuuff() function returns 0 on success, or EOF if the request cannot + be honored (note that the stream is still functional in this case). + + The sseettlliinneebbuuff() function returns what the equivalent sseettvvbbuuff() would + have returned. + +SSEEEE AALLSSOO + fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3) + +SSTTAANNDDAARRDDSS + The sseettbbuuff() and sseettvvbbuuff() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + The sseettbbuuffffeerr() and sseettlliinneebbuuff() functions are not portable to versions + of BSD before 4.2BSD. On 4.2BSD and 4.3BSD systems, sseettbbuuff() always uses + a suboptimal buffer size and should be avoided. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setenv.0 b/usr/share/man/cat3/setenv.0 new file mode 100644 index 0000000000..950f18b3c3 --- /dev/null +++ b/usr/share/man/cat3/setenv.0 @@ -0,0 +1,64 @@ +GETENV(3) BSD Programmer's Manual GETENV(3) + +NNAAMMEE + ggeetteennvv, ppuutteennvv, sseetteennvv, uunnsseetteennvv - environment variable functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _i_n_t + sseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _c_o_n_s_t _c_h_a_r _*_v_a_l_u_e, _i_n_t _o_v_e_r_w_r_i_t_e); + + _i_n_t + ppuutteennvv(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + uunnsseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + These functions set, unset and fetch environment variables from the host + _e_n_v_i_r_o_n_m_e_n_t _l_i_s_t. For compatibility with differing environment conven- + tions, the given arguments _n_a_m_e and _v_a_l_u_e may be appended and prepended, + respectively, with an equal sign ``=''. + + The ggeetteennvv() function obtains the current value of the environment vari- + able, _n_a_m_e. If the variable _n_a_m_e is not in the current environment , a + null pointer is returned. + + The sseetteennvv() function inserts or resets the environment variable _n_a_m_e in + the current environment list. If the variable _n_a_m_e does not exist in the + list, it is inserted with the given _v_a_l_u_e_. If the variable does exist, + the argument _o_v_e_r_w_r_i_t_e is tested; if _o_v_e_r_w_r_i_t_e _i_s zero, the variable is + not reset, otherwise it is reset to the given _v_a_l_u_e. + + The ppuutteennvv() function takes an argument of the form ``name=value'' and is + equivalent to: + + setenv(name, value, 1); + + The uunnsseetteennvv() function deletes all instances of the variable name point- + ed to by _n_a_m_e from the list. + +RREETTUURRNN VVAALLUUEESS + The functions sseetteennvv() and ppuutteennvv() return zero if successful; otherwise + the global variable _e_r_r_n_o is set to indicate the error and a -1 is re- + turned. + +EERRRROORRSS + [ENOMEM] The function sseetteennvv() or ppuutteennvv() failed because they were un- + able to allocate memory for the environment. + +SSEEEE AALLSSOO + csh(1), sh(1), execve(2), environ(7) + +SSTTAANNDDAARRDDSS + The ggeetteennvv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions sseetteennvv() and uunnsseetteennvv() appeared in Version 7 AT&T UNIX. + The ppuutteennvv() function appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/setfsent.0 b/usr/share/man/cat3/setfsent.0 new file mode 100644 index 0000000000..517e0b56c1 --- /dev/null +++ b/usr/share/man/cat3/setfsent.0 @@ -0,0 +1,76 @@ +GETFSENT(3) BSD Programmer's Manual GETFSENT(3) + +NNAAMMEE + ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system de- + scriptor file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _f_s_t_a_b _* + ggeettffsseenntt(_v_o_i_d); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r _*_s_p_e_c); + + _s_t_r_u_c_t _f_s_t_a_b _* + ggeettffssffiillee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e); + + _i_n_t + sseettffsseenntt(_v_o_i_d); + + _v_o_i_d + eennddffsseenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a + pointer to an object with the following structure containing the broken- + out fields of a line in the file system description file, <_f_s_t_a_b_._h>. + + struct fstab { + char *fs_spec; /* block special device name */ + char *fs_file; /* file system path prefix */ + char *fs_vfstype; /* type of file system */ + char *fs_mntops; /* comma separated mount options */ + char *fs_type; /* rw, ro, sw, or xx */ + int fs_freq; /* dump frequency, in days */ + int fs_passno; /* pass number on parallel dump */ + }; + + The fields have meanings described in fstab(5). + + The sseettffsseenntt() function opens the file (closing any previously opened + file) or rewinds it if it is already open. + + The eennddffsseenntt() function closes the file. + + The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening + it if necessary) for a matching special file name or file system file + name. + + For programs wishing to read the entire database, ggeettffsseenntt() reads the + next entry (opening the file if necessary). + + All entries in the file with a type field equivalent to FSTAB_XX are ig- + nored. + +RREETTUURRNN VVAALLUUEESS + The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null + pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on fail- + ure, 1 on success. The eennddffsseenntt() function returns nothing. + +FFIILLEESS + /etc/fstab + +SSEEEE AALLSSOO + fstab(5) + +HHIISSTTOORRYY + The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), + ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setgrent.0 b/usr/share/man/cat3/setgrent.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/setgrent.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setgrfile.0 b/usr/share/man/cat3/setgrfile.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/setgrfile.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setgroupent.0 b/usr/share/man/cat3/setgroupent.0 new file mode 100644 index 0000000000..9503273b84 --- /dev/null +++ b/usr/share/man/cat3/setgroupent.0 @@ -0,0 +1,96 @@ +GETGRENT(3) BSD Programmer's Manual GETGRENT(3) + +NNAAMMEE + ggeettggrreenntt, ggeettggrrnnaamm, ggeettggrrggiidd, sseettggrroouuppeenntt, sseettggrreenntt, eennddggrreenntt - group + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrreenntt(_v_o_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrnnaamm(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _g_r_o_u_p _* + ggeettggrrggiidd(_g_i_d___t _g_i_d); + + _s_t_r_u_c_t _g_r_o_u_p _* + sseettggrroouuppeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettggrreenntt(_v_o_i_d); + + _v_o_i_d + eennddggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the group database file _/_e_t_c_/_g_r_o_u_p which is + described in group(5). Each line of the database is defined by the + structure _g_r_o_u_p found in the include file <_g_r_p_._h>: + + struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ + }; + + The functions ggeettggrrnnaamm() and ggeettggrrggiidd() search the group database for the + given group name pointed to by _n_a_m_e or the group id pointed to by _g_i_d, + respectively, returning the first one encountered. Identical group names + or group gids may result in undefined behavior. + + The ggeettggrreenntt() function sequentially reads the group database and is in- + tended for programs that wish to step through the complete list of + groups. + + All three routines will open the group file for reading, if necesssary. + + The sseettggrroouuppeenntt() function opens the file, or rewinds it if it is already + open. If _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, signifi- + cantly speeding functions subsequent calls. This functionality is unnec- + essary for ggeettggrreenntt() as it doesn't close its file descriptors by de- + fault. It should also be noted that it is dangerous for long-running + programs to use this functionality as the group file may be updated. + + The sseettggrreenntt() function is identical to sseettggrroouuppeenntt() with an argument of + zero. + + The eennddggrreenntt() function closes any open files. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), and ggeettggrrggiidd(), return a pointer to + the group entry if successful; if end-of-file is reached or an error oc- + curs a null pointer is returned. The functions sseettggrroouuppeenntt() and + sseettggrreenntt() return the value 1 if successful, otherwise the value 0 is re- + turned. The functions eennddggrreenntt() and sseettggrrffiillee() have no return value. + +FFIILLEESS + /etc/group group database file + +SSEEEE AALLSSOO + ggeettppwweenntt(_3), ggrroouupp(_5) + +HHIISSTTOORRYY + The functions eennddggrreenntt(), ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), and + sseettggrreenntt() appeared in Version 7 AT&T UNIX. The functions sseettggrrffiillee() + and sseettggrroouuppeenntt() appeared in 4.3BSD-Reno. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function sseettggrrffiillee(), which allowed the specification of al- + ternate password databases, has been deprecated and is no longer avail- + able. + +BBUUGGSS + The functions ggeettggrreenntt(), ggeettggrrnnaamm(), ggeettggrrggiidd(), sseettggrroouuppeenntt() and + sseettggrreenntt() leave their results in an internal static object and return a + pointer to that object. Subsequent calls to the same function will modify + the same object. + + The functions ggeettggrreenntt(), eennddggrreenntt(), sseettggrroouuppeenntt(), and sseettggrreenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/sethostent.0 b/usr/share/man/cat3/sethostent.0 new file mode 100644 index 0000000000..37c17b4047 --- /dev/null +++ b/usr/share/man/cat3/sethostent.0 @@ -0,0 +1,135 @@ +GETHOSTBYNAME(3) BSD Programmer's Manual GETHOSTBYNAME(3) + +NNAAMMEE + ggeetthhoossttbbyynnaammee, ggeetthhoossttbbyyaaddddrr, ggeetthhoosstteenntt, sseetthhoosstteenntt, eennddhhoosstteenntt, hheerrrroorr + - get network host entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + eexxtteerrnn ssttrruucctt hh__eerrrrnnoo;; + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoossttbbyyaaddddrr(_c_h_a_r _*_a_d_d_r, _i_n_t _l_e_n, _i_n_t _t_y_p_e); + + _s_t_r_u_c_t _h_o_s_t_e_n_t _* + ggeetthhoosstteenntt(_v_o_i_d); + + sseetthhoosstteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddhhoosstteenntt(_v_o_i_d); + + hheerrrroorr(_c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() functions each return a pointer + to an object with the following structure describing an internet host + referenced by name or by address, respectively. This structure contains + either the information obtained from the name server, named(8), or bro- + ken-out fields from a line in _/_e_t_c_/_h_o_s_t_s. If the local name server is not + running these routines do a lookup in _/_e_t_c_/_h_o_s_t_s. + + 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 from name server */ + }; + #define h_addr h_addr_list[0] /* address, for backward compatibility */ + + The members of this structure are: + + _h___n_a_m_e Official name of the host. + + _h___a_l_i_a_s_e_s A zero terminated array of alternate names for the host. + + _h___a_d_d_r_t_y_p_e The type of address being returned; currently always + AF_INET. + + _h___l_e_n_g_t_h The length, in bytes, of the address. + + _h___a_d_d_r___l_i_s_t A zero terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + _h___a_d_d_r The first address in _h___a_d_d_r___l_i_s_t; this is for backward com- + patiblity. + + When using the nameserver, ggeetthhoossttbbyynnaammee() will search for + the named host in the current domain and its parents unless + the name ends in a dot. If the name contains no dot, and if + the environment variable ``HOSTALIASES'' contains the name + of an alias file, the alias file will first be searched for + an alias matching the input name. See hostname(7) for the + domain search procedure and the alias file format. + + The sseetthhoosstteenntt() function may be used to request the use of + a connected TCP socket for queries. If the _s_t_a_y_o_p_e_n flag is + non-zero, this sets the option to send all queries to the + name server using TCP and to retain the connection after + each call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). Otherwise, + queries are performed using UDP datagrams. + + The eennddhhoosstteenntt() function closes the TCP connection. + +FFIILLEESS + /etc/hosts + +DDIIAAGGNNOOSSTTIICCSS + Error return status from ggeetthhoossttbbyynnaammee() and ggeetthhoossttbbyyaaddddrr() is indicated + by return of a null pointer. The external integer _h___e_r_r_n_o may then be + checked to see whether this is a temporary failure or an invalid or un- + known host. The routine hheerrrroorr() can be used to print an error message + describing the failure. If its argument _s_t_r_i_n_g is non-NULL, it is print- + ed, followed by a colon and a space. The error message is printed with a + trailing newline. + + The variable _h___e_r_r_n_o can have the following values: + + HOST_NOT_FOUND No such host is known. + + TRY_AGAIN This is usually a temporary error and means that the lo- + cal server did not receive a response from an authorita- + tive server. A retry at some later time may succeed. + + NO_RECOVERY Some unexpected server failure was encountered. This is + a non-recoverable error. + + NO_DATA The requested name is valid but does not have an IP ad- + dress; this is not a temporary error. This means that + the name is known to the name server but there is no ad- + dress associated with this name. Another type of request + to the name server using this domain name will result in + an answer; for example, a mail-forwarder may be regis- + tered for this domain. + +SSEEEE AALLSSOO + resolver(3), hosts(5), hostname(7), named(8) + +CCAAVVEEAATT + The ggeetthhoosstteenntt() function is defined, and sseetthhoosstteenntt() and eennddhhoosstteenntt() + are redefined, when libc(3) is built to use only the routines to lookup + in _/_e_t_c_/_h_o_s_t_s and not the name server. + + The ggeetthhoosstteenntt() function reads the next line of _/_e_t_c_/_h_o_s_t_s, opening the + file if necessary. + + The sseetthhoosstteenntt() function opens and/or rewinds the file _/_e_t_c_/_h_o_s_t_s. If + the _s_t_a_y_o_p_e_n argument is non-zero, the file will not be closed after each + call to ggeetthhoossttbbyynnaammee() or ggeetthhoossttbbyyaaddddrr(). + + The eennddhhoosstteenntt() function closes the file. + +HHIISSTTOORRYY + The hheerrrroorr() function appeared in 4.3BSD. The eennddhhoosstteenntt(), + ggeetthhoossttbbyyaaddddrr(), ggeetthhoossttbbyynnaammee(), ggeetthhoosstteenntt(), and sseetthhoosstteenntt() func- + tions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet address format is currently understood. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/sethostname.0 b/usr/share/man/cat3/sethostname.0 new file mode 100644 index 0000000000..96276ea867 --- /dev/null +++ b/usr/share/man/cat3/sethostname.0 @@ -0,0 +1,48 @@ +GETHOSTNAME(3) BSD Programmer's Manual GETHOSTNAME(3) + +NNAAMMEE + ggeetthhoossttnnaammee, sseetthhoossttnnaammee - get/set name of current host + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ggeetthhoossttnnaammee(_c_h_a_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + + _i_n_t + sseetthhoossttnnaammee(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _i_n_t _n_a_m_e_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + GGeetthhoossttnnaammee() returns the standard host name for the current processor, + as previously set by sseetthhoossttnnaammee(). The parameter _n_a_m_e_l_e_n specifies the + size of the _n_a_m_e array. The returned name is null-terminated unless in- + sufficient space is provided. + + SSeetthhoossttnnaammee() sets the name of the host machine to be _n_a_m_e, which has + length _n_a_m_e_l_e_n. This call is restricted to the super-user and is normally + used only when the system is bootstrapped. + +RREETTUURRNN VVAALLUUEESS + If the call succeeds a value of 0 is returned. If the call fails, a val- + ue of -1 is returned and an error code is placed in the global location + _e_r_r_n_o. + +EERRRROORRSS + The following errors may be returned by these calls: + + [EFAULT] The _n_a_m_e or _n_a_m_e_l_e_n parameter gave an invalid address. + + [EPERM] The caller tried to set the hostname and was not the super- + user. + +SSEEEE AALLSSOO + sysctl(2) gethostid(3) + +BBUUGGSS + Host names are limited to MAXHOSTNAMELEN (from <_s_y_s_/_p_a_r_a_m_._h>) characters, + currently 256. + +HHIISSTTOORRYY + The ggeetthhoossttnnaammee function call appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/setjmp.0 b/usr/share/man/cat3/setjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/setjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setkey.0 b/usr/share/man/cat3/setkey.0 new file mode 100644 index 0000000000..af78b5cc72 --- /dev/null +++ b/usr/share/man/cat3/setkey.0 @@ -0,0 +1,106 @@ +CRYPT(3) BSD Programmer's Manual CRYPT(3) + +NNAAMMEE + ccrryypptt, sseettkkeeyy, eennccrryypptt, ddeess__sseettkkeeyy, ddeess__cciipphheerr - DES encryption + +SSYYNNOOPPSSIISS + _c_h_a_r + **ccrryypptt(_c_o_n_s_t _c_h_a_r _*_k_e_y, _c_o_n_s_t _c_h_a_r _*_s_e_t_t_i_n_g); + + _i_n_t + sseettkkeeyy(_c_h_a_r _*_k_e_y); + + _i_n_t + eennccrryypptt(_c_h_a_r _*_b_l_o_c_k, _i_n_t _f_l_a_g); + + _i_n_t + ddeess__sseettkkeeyy(_c_o_n_s_t _c_h_a_r _*_k_e_y); + + _i_n_t + ddeess__cciipphheerr(_c_o_n_s_t _c_h_a_r _*_i_n, _c_h_a_r _*_o_u_t, _l_o_n_g _s_a_l_t, _i_n_t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The crypt function performs password encryption. It is derived from the + NBS Data Encryption Standard. Additional code has been added to deter + key search attempts. The first argument to ccrryypptt is a NUL-terminated + string (normally a password typed by a user). The second is a character + array, 9 bytes in length, consisting of an underscore (``_'') followed by + 4 bytes of iteration count and 4 bytes of salt. Both the iteration _c_o_u_n_t + and the _s_a_l_t are encoded with 6 bits per character, least significant + bits first. The values 0 to 63 are encoded by the characters ``./0-9A- + Za-z'', respectively. + + The _s_a_l_t is used to induce disorder in to the DES algorithm in one of + 16777216 possible ways (specifically, if bit _i of the _s_a_l_t is set then + bits _i and _i_+_2_4 are swapped in the DES ``E'' box output). The _k_e_y is di- + vided into groups of 8 characters (a short final group is null-padded) + and the low-order 7 bits of each each character (56 bits per group) are + used to form the DES key as follows: the first group of 56 bits becomes + the initial DES key. For each additional group, the XOR of the group + bits and the encryption of the DES key with itself becomes the next DES + key. Then the final DES key is used to perform _c_o_u_n_t cumulative encryp- + tions of a 64-bit constant. The value returned is a NUL-terminated + string, 20 bytes in length, consisting of the _s_e_t_t_i_n_g followed by the en- + coded 64-bit encryption. + + For compatibility with historical versions of crypt(3), the _s_e_t_t_i_n_g may + consist of 2 bytes of salt, encoded as above, in which case an iteration + _c_o_u_n_t of 25 is used, fewer perturbations of DES are available, at most 8 + characters of _k_e_y are used, and the returned value is a NUL-terminated + string 13 bytes in length. + + The functions, eennccrryypptt(), sseettkkeeyy(), ddeess__sseettkkeeyy() and ddeess__cciipphheerr() allow + limited access to the DES algorithm itself. The _k_e_y argument to sseettkkeeyy() + is a 64 character array of binary values (numeric 0 or 1). A 56-bit key + is derived from this array by dividing the array into groups of 8 and ig- + noring the last bit in each group. + + The eennccrryypptt() argument _b_l_o_c_k is also a 64 character array of binary val- + ues. If the value of _f_l_a_g is 0, the argument _b_l_o_c_k is encrypted, other- + wise it is decrypted. The encryption or decryption is returned in the + original array _b_l_o_c_k after using the key specified by sseettkkeeyy() to process + it. + + The ddeess__sseettkkeeyy() and ddeess__cciipphheerr() functions are faster but less portable + than sseettkkeeyy() and eennccrryypptt(). The argument to ddeess__sseettkkeeyy() is a character + array of length 8. The _l_e_a_s_t significant bit in each character is ig- + nored and the next 7 bits of each character are concatenated to yield a + 56-bit key. The function ddeess__cciipphheerr() encrypts (or decrypts if _c_o_u_n_t is + negative) the 64-bits stored in the 8 characters at _i_n using abs(3) of + _c_o_u_n_t iterations of DES and stores the 64-bit result in the 8 characters + at _o_u_t. The _s_a_l_t specifies perturbations to DES as described above. + + The function ccrryypptt() returns a pointer to the encrypted value on success + and NULL on failure. The functions sseettkkeeyy(), eennccrryypptt(), ddeess__sseettkkeeyy(), + and ddeess__cciipphheerr() return 0 on success and 1 on failure. Historically, the + functions sseettkkeeyy() and eennccrryypptt() did not return any value. They have + been provided return values primarily to distinguish implementations + where hardware support is provided but not available or where the DES en- + cryption is not available due to the usual political silliness. + +SSEEEE AALLSSOO + login(1), passwd(1), getpass(3), passwd(5) + + + Wayne Patterson, _M_a_t_h_e_m_a_t_i_c_a_l _C_r_y_p_t_o_l_o_g_y _f_o_r _C_o_m_p_u_t_e_r _S_c_i_e_n_t_i_s_t_s _a_n_d + _M_a_t_h_e_m_a_t_i_c_i_a_n_s, ISBN 0-8476-7438-X, 1987. + + R. Morris, and Ken Thompson, "Password Security: A Case History", + _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, vol. 22, pp. 594-597, Nov. 1979. + + M.E. Hellman, "DES will be Totally Insecure within Ten Years", _I_E_E_E + _S_p_e_c_t_r_u_m, vol. 16, pp. 32-39, July 1979. + +HHIISSTTOORRYY + A rotor-based ccrryypptt() function appeared in Version 6 AT&T UNIX. The cur- + rent style ccrryypptt() first appeared in Version 7 AT&T UNIX. + +BBUUGGSS + Dropping the _l_e_a_s_t significant bit in each character of the argument to + ddeess__sseettkkeeyy() is ridiculous. + + The ccrryypptt() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ccrryypptt() will modi- + fy the same object. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setlinebuf.0 b/usr/share/man/cat3/setlinebuf.0 new file mode 100644 index 0000000000..d43a301bed --- /dev/null +++ b/usr/share/man/cat3/setlinebuf.0 @@ -0,0 +1,91 @@ +SETBUF(3) BSD Programmer's Manual SETBUF(3) + +NNAAMMEE + sseettbbuuff, sseettbbuuffffeerr, sseettlliinneebbuuff, sseettvvbbuuff - stream buffering operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + sseettbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f); + + _v_o_i_d + sseettbbuuffffeerr(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _s_i_z_e___t _s_i_z_e); + + _i_n_t + sseettlliinneebbuuff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + sseettvvbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _i_n_t _m_o_d_e, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The three types of buffering available are unbuffered, block buffered, + and line buffered. When an output stream is unbuffered, information ap- + pears 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 + stdin). The function fflush(3) may be used to force the block out early. + (See fclose(3).) + + Normally all files are block buffered. When the first I/O operation oc- + curs on a file, malloc(3) is called, and an optimally-sized buffer is ob- + tained. If a stream refers to a terminal (as _s_t_d_o_u_t normally does) it is + line buffered. The standard error stream _s_t_d_e_r_r is always unbuffered. + + The sseettvvbbuuff() function may be used to alter the buffering behavior of a + stream. The _m_o_d_e parameter must be one of the following three macros: + + _IONBF unbuffered + + _IOLBF line buffered + + _IOFBF fully buffered + + The _s_i_z_e parameter may be given as zero to obtain deferred optimal-size + buffer allocation as usual. If it is not zero, then except for un- + buffered files, the _b_u_f argument should point to a buffer at least _s_i_z_e + bytes long; this buffer will be used instead of the current buffer. (If + the _s_i_z_e argument is not zero but _b_u_f is NULL, a buffer of the given size + will be allocated immediately, and released on close. This is an exten- + sion to ANSI C; portable code should use a size of 0 with any NULL + buffer.) + + The sseettvvbbuuff() function may be used at any time, but may have peculiar + side effects (such as discarding input or flushing output) if the stream + is ``active''. Portable applications should call it only once on any + given stream, and before any I/O is performed. + + The other three calls are, in effect, simply aliases for calls to + sseettvvbbuuff(). Except for the lack of a return value, the sseettbbuuff() function + is exactly equivalent to the call + + setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + + + The sseettbbuuffffeerr() function is the same, except that the size of the buffer + is up to the caller, rather than being determined by the default BUFSIZ. + The sseettlliinneebbuuff() function is exactly equivalent to the call: + + setvbuf(stream, (char *)NULL, _IOLBF, 0); + +RREETTUURRNN VVAALLUUEESS + The sseettvvbbuuff() function returns 0 on success, or EOF if the request cannot + be honored (note that the stream is still functional in this case). + + The sseettlliinneebbuuff() function returns what the equivalent sseettvvbbuuff() would + have returned. + +SSEEEE AALLSSOO + fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3) + +SSTTAANNDDAARRDDSS + The sseettbbuuff() and sseettvvbbuuff() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + The sseettbbuuffffeerr() and sseettlliinneebbuuff() functions are not portable to versions + of BSD before 4.2BSD. On 4.2BSD and 4.3BSD systems, sseettbbuuff() always uses + a suboptimal buffer size and should be avoided. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setlocale.0 b/usr/share/man/cat3/setlocale.0 new file mode 100644 index 0000000000..40d261b62e --- /dev/null +++ b/usr/share/man/cat3/setlocale.0 @@ -0,0 +1,179 @@ +SETLOCALE(3) BSD Programmer's Manual SETLOCALE(3) + +NNAAMMEE + sseettllooccaallee, llooccaalleeccoonnvv - natural language formatting for C + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + sseettllooccaallee(_i_n_t _c_a_t_e_g_o_r_y, _c_o_n_s_t _c_h_a_r _*_l_o_c_a_l_e); + + _s_t_r_u_c_t _l_c_o_n_v _* + llooccaalleeccoonnvv(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The sseettllooccaallee() function sets the C library's notion of natural language + formatting style for particular sets of routines. Each such style is + called a `locale' and is invoked using an appropriate name passed as a C + string. The llooccaalleeccoonnvv() routine returns the current locale's parameters + for formatting numbers. + + The sseettllooccaallee() function recognizes several categories of routines. + These are the categories and the sets of routines they select: + + LC_ALL Set the entire locale generically. + + LC_COLLATE Set a locale for string collation routines. This controls + alphabetic ordering in ssttrrccoollll() and ssttrrxxffrrmm(). + + LC_CTYPE Set a locale for the ctype(3), mbrune(3), multibyte(3) and + rune(3) functions. This controls recognition of upper and + lower case, alphabetic or non-alphabetic characters, and so + on. The real work is done by the sseettrruunneellooccaallee() function. + + LC_MONETARY Set a locale for formatting monetary values; this affects + the llooccaalleeccoonnvv() function. + + LC_NUMERIC Set a locale for formatting numbers. This controls the for- + matting of decimal points in input and output of floating + point numbers in functions such as pprriinnttff() and ssccaannff(), as + well as values returned by llooccaalleeccoonnvv(). + + LC_TIME Set a locale for formatting dates and times using the + ssttrrffttiimmee() function. + + Only three locales are defined by default, the empty string "" which de- + notes the native environment, and the "C" and locales, which denote the C + language environment. A _l_o_c_a_l_e argument of NULL causes sseettllooccaallee() to + return the current locale. By default, C programs start in the "C" lo- + cale. The only function in the library that sets the locale is + sseettllooccaallee(); the locale is never changed as a side effect of some other + routine. + + The llooccaalleeccoonnvv() function returns a pointer to a structure which provides + parameters for formatting numbers, especially currency values: + + struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + }; + + The individual fields have the following meanings: + + _d_e_c_i_m_a_l___p_o_i_n_t The decimal point character, except for currency val- + ues. + + _t_h_o_u_s_a_n_d_s___s_e_p The separator between groups of digits before the dec- + imal point, except for currency values. + + _g_r_o_u_p_i_n_g The sizes of the groups of digits, except for currency + values. This is a pointer to a vector of integers, + each of size _c_h_a_r, representing group size from low + order digit groups to high order (right to left). The + list may be terminated with 0 or CHAR_MAX. If the list + is terminated with 0, the last group size before the 0 + is repeated to account for all the digits. If the + list is terminated with CHAR_MAX, no more grouping is + performed. + + _i_n_t___c_u_r_r___s_y_m_b_o_l The standardized international currency symbol. + + _c_u_r_r_e_n_c_y___s_y_m_b_o_l The local currency symbol. + + _m_o_n___d_e_c_i_m_a_l___p_o_i_n_t The decimal point character for currency values. + + _m_o_n___t_h_o_u_s_a_n_d_s___s_e_p The separator for digit groups in currency values. + + _m_o_n___g_r_o_u_p_i_n_g Like _g_r_o_u_p_i_n_g but for currency values. + + _p_o_s_i_t_i_v_e___s_i_g_n The character used to denote nonnegative currency val- + ues, usually the empty string. + + _n_e_g_a_t_i_v_e___s_i_g_n The character used to denote negative currency values, + usually a minus sign. + + _i_n_t___f_r_a_c___d_i_g_i_t_s The number of digits after the decimal point in an in- + ternational-style currency value. + + _f_r_a_c___d_i_g_i_t_s The number of digits after the decimal point in the + local style for currency values. + + _p___c_s___p_r_e_c_e_d_e_s 1 if the currency symbol precedes the currency value + for nonnegative values, 0 if it follows. + + _p___s_e_p___b_y___s_p_a_c_e 1 if a space is inserted between the currency symbol + and the currency value for nonnegative values, 0 oth- + erwise. + + _n___c_s___p_r_e_c_e_d_e_s Like _p___c_s___p_r_e_c_e_d_e_s but for negative values. + + _n___s_e_p___b_y___s_p_a_c_e Like _p___s_e_p___b_y___s_p_a_c_e but for negative values. + + _p___s_i_g_n___p_o_s_n The location of the _p_o_s_i_t_i_v_e___s_i_g_n with respect to a + nonnegative quantity and the _c_u_r_r_e_n_c_y___s_y_m_b_o_l, coded as + + follows: + 0 Parentheses around the entire string. + 1 Before the string. + 2 After the string. + 3 Just before _c_u_r_r_e_n_c_y___s_y_m_b_o_l. + 4 Just after _c_u_r_r_e_n_c_y___s_y_m_b_o_l. + + _n___s_i_g_n___p_o_s_n Like _p___s_i_g_n___p_o_s_n but for negative currency values. + + Unless mentioned above, an empty string as a value for a field indicates + a zero length result or a value that is not in the current locale. A + CHAR_MAX result similarly denotes an unavailable value. + +RREETTUURRNN VVAALLUUEESS + The sseettllooccaallee() function returns NULL and fails to change the locale if + the given combination of _c_a_t_e_g_o_r_y and _l_o_c_a_l_e makes no sense. The + llooccaalleeccoonnvv() function returns a pointer to a static object which may be + altered by later calls to sseettllooccaallee() or llooccaalleeccoonnvv(). + +FFIILLEESS + $PATH_LOCALE/_l_o_c_a_l_e/_c_a_t_e_g_o_r_y + /usr/share/locale/_l_o_c_a_l_e/_c_a_t_e_g_o_r_y locale file for the locale _l_o_c_a_l_e and + the category _c_a_t_e_g_o_r_y. + +SSEEEE AALLSSOO + euc(4), mbrune(3), multibyte(3), rune(3), strcoll(3), strxfrm(3), + utf2(4) + +SSTTAANNDDAARRDDSS + The sseettllooccaallee() and llooccaalleeccoonnvv() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +HHIISSTTOORRYY + The sseettllooccaallee() and llooccaalleeccoonnvv() functions first appeared in 4.4BSD. + +BBUUGGSS + The current implementation supports only the "C" and "POSIX" locales for + all but the LC_CTYPE locale. + + In spite of the gnarly currency support in llooccaalleeccoonnvv(), the standards + don't include any functions for generalized currency formatting. + + LC_COLLATE does not make sense for many languages. Use of LC_MONETARY + could lead to misleading results until we have a real time currency con- + version function. LC_NUMERIC and LC_TIME are personal choices and should + not be wrapped up with the other categories. + +4.4BSD June 9, 1993 3 diff --git a/usr/share/man/cat3/setlogmask.0 b/usr/share/man/cat3/setlogmask.0 new file mode 100644 index 0000000000..cbcb3a15d5 --- /dev/null +++ b/usr/share/man/cat3/setlogmask.0 @@ -0,0 +1,150 @@ +SYSLOG(3) BSD Programmer's Manual SYSLOG(3) + +NNAAMMEE + ssyysslloogg, vvssyysslloogg, ooppeennlloogg, cclloosseelloogg, sseettllooggmmaasskk - control system log + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + ssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _._._.); + + _v_o_i_d + vvssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + ooppeennlloogg(_c_o_n_s_t _c_h_a_r _*_i_d_e_n_t, _i_n_t _l_o_g_o_p_t, _i_n_t _f_a_c_i_l_i_t_y); + + _v_o_i_d + cclloosseelloogg(_v_o_i_d); + + _i_n_t + sseettllooggmmaasskk(_i_n_t _m_a_s_k_p_r_i); + +DDEESSCCRRIIPPTTIIOONN + The ssyysslloogg() function writes _m_e_s_s_a_g_e to the system message logger. The + message is then written to the system console, log files, logged-in + users, or forwarded to other machines as appropriate. (See syslogd(8).) + + The message is identical to a printf(3) format string, except that `%m' + is replaced by the current error message. (As denoted by the global vari- + able _e_r_r_n_o; see strerror(3).) A trailing newline is added if none is + present. + + The vvssyysslloogg() function is an alternate form in which the arguments have + already been captured using the variable-length argument facilities of + varargs(3). + + The message is tagged with _p_r_i_o_r_i_t_y. Priorities are encoded as a _f_a_c_i_l_i_t_y + and a _l_e_v_e_l. The facility describes the part of the system generating the + message. The level is selected from the following _o_r_d_e_r_e_d (high to low) + list: + + LOG_EMERG A panic condition. This is normally broadcast to all + users. + + LOG_ALERT A condition that should be corrected immediately, such as a + corrupted system database. + + LOG_CRIT Critical conditions, e.g., hard device errors. + + LOG_ERR Errors. + + LOG_WARNING Warning messages. + + LOG_NOTICE Conditions that are not error conditions, but should possi- + bly be handled specially. + + LOG_INFO Informational messages. + + LOG_DEBUG Messages that contain information normally of use only when + debugging a program. + + The ooppeennlloogg() function provides for more specialized processing of the + messages sent by ssyysslloogg() and vvssyysslloogg(). The parameter _i_d_e_n_t is a string + that will be prepended to every message. The _l_o_g_o_p_t argument is a bit + field specifying logging options, which is formed by OR'ing one or more + of the following values: + + LOG_CONS If ssyysslloogg() cannot pass the message to syslogd it will at- + tempt to write the message to the console + (``_/_d_e_v_/_c_o_n_s_o_l_e_.'') + + LOG_NDELAY Open the connection to syslogd immediately. Normally the + open is delayed until the first message is logged. Useful + for programs that need to manage the order in which file + descriptors are allocated. + + LOG_PERROR Write the message to standard error output as well to the + system log. + + LOG_PID Log the process id with each message: useful for identify- + ing instantiations of daemons. + + The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all + messages that do not have an explicit facility encoded: + + LOG_AUTH The authorization system: login(1), su(1), getty(8), + etc. + + LOG_AUTHPRIV The same as LOG_AUTH, but logged to a file readable only by + selected individuals. + + LOG_CRON The clock daemon. + + LOG_DAEMON System daemons, such as routed(8), that are not provided + for explicitly by other facilities. + + LOG_KERN Messages generated by the kernel. These cannot be generat- + ed by any user processes. + + LOG_LPR The line printer spooling system: lpr(1), lpc(8), lpd(8), + etc. + + LOG_MAIL The mail system. + + LOG_NEWS The network news system. + + LOG_SYSLOG Messages generated internally by syslogd(8). + + LOG_USER Messages generated by random user processes. This is the + default facility identifier if none is specified. + + LOG_UUCP The uucp system. + + LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through + LOG_LOCAL7. + + The cclloosseelloogg() function can be used to close the log file. + + The sseettllooggmmaasskk() function sets the log priority mask to _m_a_s_k_p_r_i and re- + turns the previous mask. Calls to ssyysslloogg() with a priority not set in + _m_a_s_k_p_r_i are rejected. The mask for an individual priority _p_r_i is calcu- + lated by the macro LLOOGG__MMAASSKK(_p_r_i); the mask for all priorities up to and + including _t_o_p_p_r_i is given by the macro LLOOGG__UUPPTTOO(_t_o_p_p_r_i);. The default al- + lows all priorities to be logged. + +RREETTUURRNN VVAALLUUEESS + The routines cclloosseelloogg(), ooppeennlloogg(), ssyysslloogg() and vvssyysslloogg() return no val- + ue. + + + The routine sseettllooggmmaasskk() always returns the previous log mask level. + +EEXXAAMMPPLLEESS + syslog(LOG_ALERT, "who: internal error 23"); + + openlog("ftpd", LOG_PID, LOG_DAEMON); + setlogmask(LOG_UPTO(LOG_ERR)); + syslog(LOG_INFO, "Connection from host %d", CallingHost); + + syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); + +SSEEEE AALLSSOO + logger(1), syslogd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/setmode.0 b/usr/share/man/cat3/setmode.0 new file mode 100644 index 0000000000..bb699dc2f7 --- /dev/null +++ b/usr/share/man/cat3/setmode.0 @@ -0,0 +1,39 @@ +SETMODE(3) BSD Programmer's Manual SETMODE(3) + +NNAAMMEE + ggeettmmooddee, sseettmmooddee - modify mode bits + +SSYYNNOOPPSSIISS + _m_o_d_e___t + ggeettmmooddee(_c_o_n_s_t _v_o_i_d _*_s_e_t, _m_o_d_e___t _m_o_d_e); + + _v_o_i_d + sseettmmooddee(_c_o_n_s_t _c_h_a_r _*_m_o_d_e___s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ggeettmmooddee() function returns a copy of the file permission bits _m_o_d_e as + altered by the values pointed to by _s_e_t. While only the mode bits are al- + tered, other parts of the file mode may be examined. + + The sseettmmooddee() function takes an absolute (octal) or symbolic value, as + described in chmod(1), as an argument and returns a pointer to mode val- + ues to be supplied to ggeettmmooddee(). Because some of the symbolic values are + relative to the file creation mask, sseettmmooddee() may call umask(2). If this + occurs, the file creation mask will be restored before sseettmmooddee() returns. + If the calling program changes the value of its file creation mask after + calling sseettmmooddee(), sseettmmooddee() must be called again if ggeettmmooddee() is to mod- + ify future file modes correctly. + + If the mode passed to sseettmmooddee() is invalid, sseettmmooddee() returns NULL. + +EERRRROORRSS + The sseettmmooddee() function may fail and set errno for any of the errors spec- + ified for the library routine malloc(3). + +SSEEEE AALLSSOO + chmod(1), stat(2), umask(2), malloc(3) + +HHIISSTTOORRYY + The ggeettmmooddee() and sseettmmooddee() functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/setnetent.0 b/usr/share/man/cat3/setnetent.0 new file mode 100644 index 0000000000..24b8430da1 --- /dev/null +++ b/usr/share/man/cat3/setnetent.0 @@ -0,0 +1,81 @@ +GETNETENT(3) BSD Programmer's Manual GETNETENT(3) + +NNAAMMEE + ggeettnneetteenntt, ggeettnneettbbyyaaddddrr, ggeettnneettbbyynnaammee, sseettnneetteenntt, eennddnneetteenntt - get network + entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneetteenntt(); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _n_e_t_e_n_t _* + ggeettnneettbbyyaaddddrr(_l_o_n_g _n_e_t, _i_n_t _t_y_p_e); + + sseettnneetteenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddnneetteenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettnneetteenntt(), ggeettnneettbbyynnaammee(), and ggeettnneettbbyyaaddddrr() functions each return + a pointer to an object with the following structure containing the bro- + ken-out fields of a line in the network data base, _/_e_t_c_/_n_e_t_w_o_r_k_s. + + struct netent { + char *n_name; /* official name of net */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net number type */ + unsigned long n_net; /* net number */ + }; + + The members of this structure are: + + _n___n_a_m_e The official name of the network. + + _n___a_l_i_a_s_e_s A zero terminated list of alternate names for the network. + + _n___a_d_d_r_t_y_p_e The type of the network number returned; currently only + AF_INET. + + _n___n_e_t The network number. Network numbers are returned in machine + byte order. + + The ggeettnneetteenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettnneetteenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettnneettbbyynnaammee() or ggeettnneettbbyyaaddddrr(). + + The eennddnneetteenntt() function closes the file. + + The ggeettnneettbbyynnaammee() function and ggeettnneettbbyyaaddddrr() sequentially search from + the beginning of the file until a matching net name or net address and + type is found, or until EOF is encountered. Network numbers are supplied + in host order. + +FFIILLEESS + /etc/networks + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + networks(5) + +HHIISSTTOORRYY + The ggeettnneetteenntt(), ggeettnneettbbyyaaddddrr(), ggeettnneettbbyynnaammee(), sseettnneetteenntt(), and + eennddnneetteenntt() functions appeared in 4.2BSD. + +BBUUGGSS + The data space used by these functions is static; if future use requires + the data, it should be copied before any subsequent calls to these func- + tions overwrite it. Only Internet network numbers are currently under- + stood. Expecting network numbers to fit in no more than 32 bits is prob- + ably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setnetgrent.0 b/usr/share/man/cat3/setnetgrent.0 new file mode 100644 index 0000000000..1588f2b94f --- /dev/null +++ b/usr/share/man/cat3/setnetgrent.0 @@ -0,0 +1,64 @@ +GETNETGRENT(3) BSD Programmer's Manual GETNETGRENT(3) + +NNAAMMEE + ggeettnneettggrreenntt, iinnnneettggrr, sseettnneettggrreenntt, eennddnneettggrreenntt - netgroup database opera- + tions + +SSYYNNOOPPSSIISS + _i_n_t + ggeettnneettggrreenntt(_c_h_a_r _*_*_h_o_s_t_, _c_h_a_r _*_*_u_s_e_r_, _c_h_a_r _*_*_d_o_m_a_i_n); + + _i_n_t + iinnnneettggrr(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p_, _c_o_n_s_t _c_h_a_r _*_h_o_s_t_, _c_o_n_s_t _c_h_a_r _*_u_s_e_r_, ); + + _v_o_i_d + sseettnneettggrreenntt(_c_o_n_s_t _c_h_a_r _*_n_e_t_g_r_o_u_p); + + _v_o_i_d + eennddnneettggrreenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the netgroup database file _/_e_t_c_/_n_e_t_g_r_o_u_p which + is described in netgroup(5). The database defines a set of netgroups, + each made up of one or more triples: + + (host, user, domain) + that defines a combination of host, user and domain. Any of the three + fields may be specified as ``wildcards'' that match any string. + + The function ggeettnneettggrreenntt() sets the three pointer arguments to the + strings of the next member of the current netgroup. If any of the string + pointers are ((cchhaarr **))00 that field is considered a wildcard. + + The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() set the current netgroup + and terminate the current netgroup respectively. If sseettnneettggrreenntt() is + called with a different netgroup than the previous call, an implicit + eennddnneettggrreenntt() is implied. SSeettnneettggrreenntt() also sets the offset to the + first member of the netgroup. + + The function iinnnneettggrr() searches for a match of all fields within the + specified group. If any of the hhoosstt, uusseerr, or ddoommaaiinn arguments are ((cchhaarr + **))00 those fields will match any string value in the netgroup member. + +RREETTUURRNN VVAALLUUEESS + The function ggeettnneettggrreenntt() returns 0 for ``no more netgroup members'' and + 1 otherwise. The function iinnnneettggrr() returns 1 for a successful match and + 0 otherwise. The functions sseettnneettggrreenntt() and eennddnneettggrreenntt() have no re- + turn value. + +FFIILLEESS + /etc/netgroup netgroup database file + +SSEEEE AALLSSOO + nneettggrroouupp(_5) + +CCOOMMPPAATTIIBBIILLIITTYY + The netgroup members have three string fields to maintain compatibility + with other vendor implementations, however it is not obvious what use the + ddoommaaiinn string has within BSD. + +BBUUGGSS + The function ggeettnneettggrreenntt() returns pointers to dynamically allocated data + areas that are free'd when the function eennddnneettggrreenntt() is called. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/setpassent.0 b/usr/share/man/cat3/setpassent.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/setpassent.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setprotoent.0 b/usr/share/man/cat3/setprotoent.0 new file mode 100644 index 0000000000..7fcb0b58f3 --- /dev/null +++ b/usr/share/man/cat3/setprotoent.0 @@ -0,0 +1,75 @@ +GETPROTOENT(3) BSD Programmer's Manual GETPROTOENT(3) + +NNAAMMEE + ggeettpprroottooeenntt, ggeettpprroottoobbyynnuummbbeerr, ggeettpprroottoobbyynnaammee, sseettpprroottooeenntt, eennddpprroottooeenntt - + get protocol entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottooeenntt(); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnaammee(_c_h_a_r _*_n_a_m_e); + + _s_t_r_u_c_t _p_r_o_t_o_e_n_t _* + ggeettpprroottoobbyynnuummbbeerr(_i_n_t _p_r_o_t_o); + + sseettpprroottooeenntt(_i_n_t _s_t_a_y_o_p_e_n); + + eennddpprroottooeenntt(); + +DDEESSCCRRIIPPTTIIOONN + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnaammee(), and ggeettpprroottoobbyynnuummbbeerr() functions + each return a pointer to an object with the following structure contain- + ing the broken-out fields of a line in the network protocol data base, + _/_e_t_c_/_p_r_o_t_o_c_o_l_s. + + + struct protoent { + char *p_name; /* official name of protocol */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ + }; + + The members of this structure are: + + _p___n_a_m_e The official name of the protocol. + + _p___a_l_i_a_s_e_s A zero terminated list of alternate names for the protocol. + + _p___p_r_o_t_o The protocol number. + + The ggeettpprroottooeenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettpprroottooeenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettpprroottoobbyynnaammee() or ggeettpprroottoobbyynnuummbbeerr(). + + The eennddpprroottooeenntt() function closes the file. + + The ggeettpprroottoobbyynnaammee() function and ggeettpprroottoobbyynnuummbbeerr() sequentially search + from the beginning of the file until a matching protocol name or protocol + number is found, or until EOF is encountered. + +RREETTUURRNN VVAALLUUEESS + Null pointer (0) returned on EOF or error. + +FFIILLEESS + /etc/protocols + +SSEEEE AALLSSOO + protocols(5) + +HHIISSTTOORRYY + The ggeettpprroottooeenntt(), ggeettpprroottoobbyynnuummbbeerr(), ggeettpprroottoobbyynnaammee(), sseettpprroottooeenntt(), + and eennddpprroottooeenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use a static data space; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Only + the Internet protocols are currently understood. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setpwent.0 b/usr/share/man/cat3/setpwent.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/setpwent.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setpwfile.0 b/usr/share/man/cat3/setpwfile.0 new file mode 100644 index 0000000000..d78350eaee --- /dev/null +++ b/usr/share/man/cat3/setpwfile.0 @@ -0,0 +1,112 @@ +GETPWENT(3) BSD Programmer's Manual GETPWENT(3) + +NNAAMMEE + ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppaasssseenntt, sseettppwweenntt, eennddppwweenntt - password + database operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwweenntt(_v_o_i_d); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwnnaamm(_c_o_n_s_t _c_h_a_r _*_l_o_g_i_n); + + _s_t_r_u_c_t _p_a_s_s_w_d _* + ggeettppwwuuiidd(_u_i_d___t _u_i_d); + + _i_n_t + sseettppaasssseenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _i_n_t + sseettppwweenntt(_v_o_i_d); + + _v_o_i_d + eennddppwweenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the password database file which is described + in passwd(5). Each entry in the database is defined by the structure + _p_a_s_s_w_d found in the include file <_p_w_d_._h>: + + struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ + }; + + The functions ggeettppwwnnaamm() and ggeettppwwuuiidd() search the password database for + the given login name or user uid, respectively, always returning the + first one encountered. + + The ggeettppwweenntt() function sequentially reads the password database and is + intended for programs that wish to process the complete list of users. + + The sseettppaasssseenntt() function accomplishes two purposes. First, it causes + ggeettppwweenntt() to ``rewind'' to the beginning of the database. Additionally, + if _s_t_a_y_o_p_e_n is non-zero, file descriptors are left open, significantly + speeding up subsequent accesses for all of the routines. (This latter + functionality is unnecessary for ggeettppwweenntt() as it doesn't close its file + descriptors by default.) + + It is dangerous for long-running programs to keep the file descriptors + open the database will become out of date if it is updated while the pro- + gram is running. + + + The sseettppwweenntt() function is identical to sseettppaasssseenntt() with an argument of + zero. + + The eennddppwweenntt() function closes any open files. + + These routines have been written to ``shadow'' the password file, e.g. + allow only certain programs to have access to the encrypted password. If + the process which calls them has an effective uid of 0, the encrypted + password will be returned, otherwise, the password field of the retuned + structure will point to the string `*'. + +RREETTUURRNN VVAALLUUEESS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), return a valid + pointer to a passwd structure on success and a null pointer if end-of- + file is reached or an error occurs. The functions sseettppaasssseenntt() and + sseettppwweenntt() return 0 on failure and 1 on success. The eennddppwweenntt() function + has no return value. + +FFIILLEESS + /var/db/pwd.db The insecure password database file + /var/db/spwd.db The secure password database file + /etc/master.passwd The current password file + /etc/passwd A Version 7 format password file + +SSEEEE AALLSSOO + getlogin(3), getgrent(3), passwd(5), pwd_mkdb(8), vipw(8) + +HHIISSTTOORRYY + The ggeettppwweenntt, ggeettppwwnnaamm, ggeettppwwuuiidd, sseettppwweenntt,, and eennddppwweenntt functions ap- + peared in Version 7 AT&T UNIX. The sseettppaasssseenntt function appeared in + 4.3BSD-Reno. + +BBUUGGSS + The functions ggeettppwweenntt(), ggeettppwwnnaamm(), and ggeettppwwuuiidd(), leave their results + in an internal static object and return a pointer to that object. Subse- + quent calls to the same function will modify the same object. + + The routines ggeettppwweenntt(), eennddppwweenntt(), sseettppaasssseenntt(), and sseettppwweenntt() are + fairly useless in a networked environment and should be avoided, if pos- + sible. + +CCOOMMPPAATTIIBBIILLIITTYY + The historic function setpwfile(3), which allowed the specification of + alternate password databases, has been deprecated and is no longer avail- + able. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/setservent.0 b/usr/share/man/cat3/setservent.0 new file mode 100644 index 0000000000..d1f930be56 --- /dev/null +++ b/usr/share/man/cat3/setservent.0 @@ -0,0 +1,83 @@ +GETSERVENT(3) BSD Programmer's Manual GETSERVENT(3) + +NNAAMMEE + ggeettsseerrvveenntt, ggeettsseerrvvbbyyppoorrtt, ggeettsseerrvvbbyynnaammee, sseettsseerrvveenntt, eennddsseerrvveenntt - get + service entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvveenntt(); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyynnaammee(_c_h_a_r _*_n_a_m_e, _c_h_a_r _*_p_r_o_t_o); + + _s_t_r_u_c_t _s_e_r_v_e_n_t _* + ggeettsseerrvvbbyyppoorrtt(_i_n_t _p_o_r_t, _p_r_o_t_o); + + _v_o_i_d + sseettsseerrvveenntt(_i_n_t _s_t_a_y_o_p_e_n); + + _v_o_i_d + eennddsseerrvveenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyynnaammee(), and ggeettsseerrvvbbyyppoorrtt() functions each re- + turn a pointer to an object with the following structure containing the + broken-out fields of a line in the network services data base, + _/_e_t_c_/_s_e_r_v_i_c_e_s. + + struct servent { + char *s_name; /* official name of service */ + char **s_aliases; /* alias list */ + int s_port; /* port service resides at */ + char *s_proto; /* protocol to use */ + }; + + The members of this structure are: + + _s___n_a_m_e The official name of the service. + + _s___a_l_i_a_s_e_s A zero terminated list of alternate names for the service. + + _s___p_o_r_t The port number at which the service resides. Port numbers + are returned in network byte order. + + _s___p_r_o_t_o The name of the protocol to use when contacting the service. + + The ggeettsseerrvveenntt() function reads the next line of the file, opening the + file if necessary. + + The sseettsseerrvveenntt() function opens and rewinds the file. If the _s_t_a_y_o_p_e_n + flag is non-zero, the net data base will not be closed after each call to + ggeettsseerrvvbbyynnaammee() or ggeettsseerrvvbbyyppoorrtt(). + + The eennddsseerrvveenntt() function closes the file. + + The ggeettsseerrvvbbyynnaammee() and ggeettsseerrvvbbyyppoorrtt() functions sequentially search + from the beginning of the file until a matching protocol name or port + number is found, or until EOF is encountered. If a protocol name is also + supplied (non- NULL), searches must also match the protocol. + +FFIILLEESS + + + /etc/services + +DDIIAAGGNNOOSSTTIICCSS + Null pointer (0) returned on EOF or error. + +SSEEEE AALLSSOO + getprotoent(3), services(5) + +HHIISSTTOORRYY + The ggeettsseerrvveenntt(), ggeettsseerrvvbbyyppoorrtt(), ggeettsseerrvvbbyynnaammee(), sseettsseerrvveenntt(), and + eennddsseerrvveenntt() functions appeared in 4.2BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. Ex- + pecting port numbers to fit in a 32 bit quantity is probably naive. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setstate.0 b/usr/share/man/cat3/setstate.0 new file mode 100644 index 0000000000..20b591fdd7 --- /dev/null +++ b/usr/share/man/cat3/setstate.0 @@ -0,0 +1,89 @@ +RANDOM(3) BSD Programmer's Manual RANDOM(3) + +NNAAMMEE + rraannddoomm, ssrraannddoomm, iinniittssttaattee, sseettssttaattee - better random number generator; + routines for changing generators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + rraannddoomm(_v_o_i_d); + + _v_o_i_d + ssrraannddoomm(_u_n_s_i_g_n_e_d _s_e_e_d); + + _c_h_a_r _* + iinniittssttaattee(_u_n_s_i_g_n_e_d _s_e_e_d, _c_h_a_r _*_s_t_a_t_e, _i_n_t _n); + + _c_h_a_r _* + sseettssttaattee(_c_h_a_r _*_s_t_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The rraannddoomm() function uses a non-linear 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 (2**31)-1. The + period of this random number generator is very large, approximately + 16*((2**31)-1). + + The rraannddoomm()/ ssrraannddoomm() have (almost) the same calling sequence and ini- + tialization properties as rand(3)/ srand(3). The difference is that + rand produces a much less random sequence -- in fact, the low dozen bits + generated by rand go through a cyclic pattern. All the bits generated by + rraannddoomm() are usable. For example, `random()&01' will produce a random + binary value. + + Unlike srand, ssrraannddoomm() does not return the old seed; the reason for + this is that the amount of state information used is much more than a + single word. (Two other routines are provided to deal with restart- + ing/changing random number generators). Like rand(3), however, rraannddoomm() + will by default produce a sequence of numbers that can be duplicated by + calling ssrraannddoomm() with `1' as the seed. + + The iinniittssttaattee() routine allows a state array, passed in as an argument, + to be initialized for future use. The size of the state array (in bytes) + is used by iinniittssttaattee() to decide how sophisticated a random number gener- + ator it should use -- the more state, the better the random numbers will + be. (Current "optimal" values for the amount of state information 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.) The + seed for the initialization (which specifies a starting point for the + random number sequence, and provides for restarting at the same point) is + also an argument. The iinniittssttaattee() function returns a pointer to the pre- + vious state information array. + + Once a state has been initialized, the sseettssttaattee() routine provides for + rapid switching between states. The sseettssttaattee() function returns a point- + er to the previous state array; its argument state array is used for fur- + ther random number generation until the next call to iinniittssttaattee() or + sseettssttaattee(). + + Once a state array has been initialized, it may be restarted at a differ- + ent point either by calling iinniittssttaattee() (with the desired seed, the state + array, and its size) or by calling both sseettssttaattee() (with the state array) + and ssrraannddoomm() (with the desired seed). The advantage of calling both + sseettssttaattee() and ssrraannddoomm() is that the size of the state array does not + have to be remembered after it is initialized. + + With 256 bytes of state information, the period of the random number gen- + erator is greater than 2**69 which should be sufficient for most purpos- + es. + +AAUUTTHHOORR + Earl T. Cohen + +DDIIAAGGNNOOSSTTIICCSS + If iinniittssttaattee() is called with less than 8 bytes of state information, or + if sseettssttaattee() detects that the state information has been garbled, error + messages are printed on the standard error output. + +SSEEEE AALLSSOO + rand(3) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + About 2/3 the speed of rand(3). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setttyent.0 b/usr/share/man/cat3/setttyent.0 new file mode 100644 index 0000000000..5013ee00ef --- /dev/null +++ b/usr/share/man/cat3/setttyent.0 @@ -0,0 +1,98 @@ +GETTTYENT(3) BSD Programmer's Manual GETTTYENT(3) + +NNAAMMEE + ggeettttttyyeenntt, ggeettttttyynnaamm, sseettttttyyeenntt, eennddttttyyeenntt - get ttys file entry + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyyeenntt(); + + _s_t_r_u_c_t _t_t_y_e_n_t _* + ggeettttttyynnaamm(_c_h_a_r _*_n_a_m_e); + + _i_n_t + sseettttttyyeenntt(_v_o_i_d); + + _i_n_t + eennddttttyyeenntt(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettttttyyeenntt(), and ggeettttttyynnaamm() functions each return a pointer to an + object, with the following structure, containing the broken-out fields of + a line from the tty description file. + + struct ttyent { + char *ty_name; /* terminal device name */ + char *ty_getty; /* command to execute */ + char *ty_type; /* terminal type */ + #define TTY_ON 0x01 /* enable logins */ + #define TTY_SECURE 0x02 /* allow uid of 0 to login */ + int ty_status; /* flag values */ + char *ty_window; /* command for window manager */ + char *ty_comment; /* comment field */ + }; + + The fields are as follows: + + _t_y___n_a_m_e The name of the character-special file. + + _t_y___g_e_t_t_y The name of the command invoked by init(8) to initialize tty + line characteristics. + + _t_y___t_y_p_e The name of the default terminal type connected to this tty + line. + + _t_y___s_t_a_t_u_s A mask of bit fields which indicate various actions allowed + on this tty line. The possible flags are as follows: + + TTY_ON Enables logins (i.e., init(8) will start the com- + mand referenced by _t_y___g_e_t_t_y on this entry). + + TTY_SECURE Allow users with a uid of 0 to login on this ter- + minal. + + _t_y___w_i_n_d_o_w The command to execute for a window system associated with + the line. + + _t_y___c_o_m_m_e_n_t Any trailing comment field, with any leading hash marks + (``#'') or whitespace removed. + + If any of the fields pointing to character strings are unspecified, they + are returned as null pointers. The field _t_y___s_t_a_t_u_s will be zero if no + flag values are specified. + + + See ttys(5) for a more complete discussion of the meaning and usage of + the fields. + + The ggeettttttyyeenntt() function reads the next line from the ttys file, opening + the file if necessary. The sseettttttyyeenntt() function rewinds the file if + open, or opens the file if it is unopened. The eennddttttyyeenntt() function + closes any open files. + + The ggeettttttyynnaamm() function searches from the beginning of the file until a + matching _n_a_m_e is found (or until EOF is encountered). + +RREETTUURRNN VVAALLUUEESS + The routines ggeettttttyyeenntt() and ggeettttttyynnaamm() return a null pointer on EOF or + error. The sseettttttyyeenntt() function and eennddttttyyeenntt() return 0 on failure and + 1 on success. + +FFIILLEESS + /etc/ttys + +SSEEEE AALLSSOO + login(1), ttyslot(3), gettytab(5), termcap(5), ttys(5), getty(8), + init(8) + +HHIISSTTOORRYY + The ggeettttttyyeenntt(), ggeettttttyynnaamm(), sseettttttyyeenntt(), and eennddttttyyeenntt() functions ap- + peared in 4.3BSD. + +BBUUGGSS + These functions use static data storage; if the data is needed for future + use, it should be copied before any subsequent calls overwrite it. + +4.3 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/setusershell.0 b/usr/share/man/cat3/setusershell.0 new file mode 100644 index 0000000000..665697eb6e --- /dev/null +++ b/usr/share/man/cat3/setusershell.0 @@ -0,0 +1,42 @@ +GETUSERSHELL(3) BSD Programmer's Manual GETUSERSHELL(3) + +NNAAMMEE + ggeettuusseerrsshheellll, sseettuusseerrsshheellll, eenndduusseerrsshheellll - get legal user shells + +SSYYNNOOPPSSIISS + _c_h_a_r _* + ggeettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + sseettuusseerrsshheellll(_v_o_i_d); + + _v_o_i_d + eenndduusseerrsshheellll(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ggeettuusseerrsshheellll() function returns a pointer to a legal user shell as + defined by the system manager in the file _/_e_t_c_/_s_h_e_l_l_s. If _/_e_t_c_/_s_h_e_l_l_s is + unreadable or does not exist, ggeettuusseerrsshheellll() behaves as if _/_b_i_n_/_s_h and + _/_b_i_n_/_c_s_h were listed in the file. + + The ggeettuusseerrsshheellll() function reads the next line (opening the file if nec- + essary); sseettuusseerrsshheellll() rewinds the file; eenndduusseerrsshheellll() closes it. + +FFIILLEESS + /etc/shells + +DDIIAAGGNNOOSSTTIICCSS + The routine ggeettuusseerrsshheellll() returns a null pointer (0) on EOF. + +SSEEEE AALLSSOO + shells(5) + +HHIISSTTOORRYY + The ggeettuusseerrsshheellll() function appeared in 4.3BSD. + +BBUUGGSS + The ggeettuusseerrsshheellll() function leaves its result in an internal static ob- + ject and returns a pointer to that object. Subsequent calls to + ggeettuusseerrsshheellll() will modify the same object. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/setvbuf.0 b/usr/share/man/cat3/setvbuf.0 new file mode 100644 index 0000000000..d43a301bed --- /dev/null +++ b/usr/share/man/cat3/setvbuf.0 @@ -0,0 +1,91 @@ +SETBUF(3) BSD Programmer's Manual SETBUF(3) + +NNAAMMEE + sseettbbuuff, sseettbbuuffffeerr, sseettlliinneebbuuff, sseettvvbbuuff - stream buffering operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + sseettbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f); + + _v_o_i_d + sseettbbuuffffeerr(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _s_i_z_e___t _s_i_z_e); + + _i_n_t + sseettlliinneebbuuff(_F_I_L_E _*_s_t_r_e_a_m); + + _i_n_t + sseettvvbbuuff(_F_I_L_E _*_s_t_r_e_a_m, _c_h_a_r _*_b_u_f, _i_n_t _m_o_d_e, _s_i_z_e___t _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + The three types of buffering available are unbuffered, block buffered, + and line buffered. When an output stream is unbuffered, information ap- + pears 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 + stdin). The function fflush(3) may be used to force the block out early. + (See fclose(3).) + + Normally all files are block buffered. When the first I/O operation oc- + curs on a file, malloc(3) is called, and an optimally-sized buffer is ob- + tained. If a stream refers to a terminal (as _s_t_d_o_u_t normally does) it is + line buffered. The standard error stream _s_t_d_e_r_r is always unbuffered. + + The sseettvvbbuuff() function may be used to alter the buffering behavior of a + stream. The _m_o_d_e parameter must be one of the following three macros: + + _IONBF unbuffered + + _IOLBF line buffered + + _IOFBF fully buffered + + The _s_i_z_e parameter may be given as zero to obtain deferred optimal-size + buffer allocation as usual. If it is not zero, then except for un- + buffered files, the _b_u_f argument should point to a buffer at least _s_i_z_e + bytes long; this buffer will be used instead of the current buffer. (If + the _s_i_z_e argument is not zero but _b_u_f is NULL, a buffer of the given size + will be allocated immediately, and released on close. This is an exten- + sion to ANSI C; portable code should use a size of 0 with any NULL + buffer.) + + The sseettvvbbuuff() function may be used at any time, but may have peculiar + side effects (such as discarding input or flushing output) if the stream + is ``active''. Portable applications should call it only once on any + given stream, and before any I/O is performed. + + The other three calls are, in effect, simply aliases for calls to + sseettvvbbuuff(). Except for the lack of a return value, the sseettbbuuff() function + is exactly equivalent to the call + + setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + + + The sseettbbuuffffeerr() function is the same, except that the size of the buffer + is up to the caller, rather than being determined by the default BUFSIZ. + The sseettlliinneebbuuff() function is exactly equivalent to the call: + + setvbuf(stream, (char *)NULL, _IOLBF, 0); + +RREETTUURRNN VVAALLUUEESS + The sseettvvbbuuff() function returns 0 on success, or EOF if the request cannot + be honored (note that the stream is still functional in this case). + + The sseettlliinneebbuuff() function returns what the equivalent sseettvvbbuuff() would + have returned. + +SSEEEE AALLSSOO + fopen(3), fclose(3), fread(3), malloc(3), puts(3), printf(3) + +SSTTAANNDDAARRDDSS + The sseettbbuuff() and sseettvvbbuuff() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + The sseettbbuuffffeerr() and sseettlliinneebbuuff() functions are not portable to versions + of BSD before 4.2BSD. On 4.2BSD and 4.3BSD systems, sseettbbuuff() always uses + a suboptimal buffer size and should be avoided. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/sigaddset.0 b/usr/share/man/cat3/sigaddset.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigaddset.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sigdelset.0 b/usr/share/man/cat3/sigdelset.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigdelset.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sigemptyset.0 b/usr/share/man/cat3/sigemptyset.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigemptyset.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sigfillset.0 b/usr/share/man/cat3/sigfillset.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigfillset.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/siginterrupt.0 b/usr/share/man/cat3/siginterrupt.0 new file mode 100644 index 0000000000..83088bed46 --- /dev/null +++ b/usr/share/man/cat3/siginterrupt.0 @@ -0,0 +1,52 @@ +SIGINTERRUPT(3) BSD Programmer's Manual SIGINTERRUPT(3) + +NNAAMMEE + ssiiggiinntteerrrruupptt - allow signals to interrupt system calls + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggiinntteerrrruupptt(_i_n_t _s_i_g, _i_n_t _f_l_a_g); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggiinntteerrrruupptt() function is used to change the system call restart be- + havior when a system call is interrupted by the specified signal. If the + flag is false (0), then system calls will be restarted if they are inter- + rupted by the specified signal and no data has been transferred yet. + System call restart is the default behavior on 4.2BSD. + + If the flag is true (1), then restarting of system calls is disabled. If + a system call is interrupted by the specified signal and no data has been + transferred, the system call will return -1 with the global variable + _e_r_r_n_o set to EINTR. Interrupted system calls that have started transfer- + ring data will return the amount of data actually transferred. System + call interrupt is the signal behavior found on 4.1BSD and AT&T System V + UNIX systems. + + Note that the new 4.2BSD signal handling semantics are not altered in any + other way. Most notably, signal handlers always remain installed until + explicitly changed by a subsequent sigaction(2) call, and the signal mask + operates as documented in sigaction(2). Programs may switch between + restartable and interruptible system call operation as often as desired + in the execution of a program. + + Issuing a ssiiggiinntteerrrruupptt(_3) call during the execution of a signal handler + will cause the new action to take place on the next signal to be caught. + +NNOOTTEESS + This library routine uses an extension of the sigaction(2) system call + that is not available in 4.2BSD, hence it should not be used if backward + compatibility is needed. + +RREETTUURRNN VVAALLUUEESS + A 0 value indicates that the call succeeded. A -1 value indicates that + an invalid signal number has been supplied. + +SSEEEE AALLSSOO + sigaction(2), sigblock(2), sigpause(2), sigsetmask(2). + +HHIISSTTOORRYY + The ssiiggiinntteerrrruupptt() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/sigismember.0 b/usr/share/man/cat3/sigismember.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigismember.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/siglongjmp.0 b/usr/share/man/cat3/siglongjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/siglongjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/signal.0 b/usr/share/man/cat3/signal.0 new file mode 100644 index 0000000000..1a42c957ec --- /dev/null +++ b/usr/share/man/cat3/signal.0 @@ -0,0 +1,129 @@ +SIGNAL(3) BSD Programmer's Manual SIGNAL(3) + +NNAAMMEE + ssiiggnnaall - simplified software signal facilities + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + **ssiiggnnaall(_s_i_g, _f_u_n_c()); + + _v_o_i_d + (**ffuunncc)() + +DDEESSCCRRIIPPTTIIOONN + This ssiiggnnaall() facility is a simplified interface to the more general + sigaction(2) facility. + + Signals allow the manipulation of a process from outside its domain as + well as allowing the process to manipulate itself or copies of itself + (children). There are two general types of signals: those that cause ter- + mination of a process and those that do not. Signals which cause termi- + nation of a program might result from an irrecoverable error or might be + the result of a user at a terminal typing the `interrupt' character. + Signals are used when a process is stopped because it wishes to access + its control terminal while in the background (see tty(4)). Signals are + optionally generated when a process resumes after being stopped, when the + status of child processes changes, or when input is ready at the control + terminal. Most signals result in the termination of the process receiv- + ing them if no action is taken; some signals instead cause the process + receiving them to be stopped, or are simply discarded if the process has + not requested otherwise. Except for the SIGKILL and SIGSTOP signals, the + ssiiggnnaall() function allows for a signal to be caught, to be ignored, or to + generate an interupt. These signals are defined in the file <_s_i_g_n_a_l_._h>: + + NNaammee DDeeffaauulltt AAccttiioonn DDeessccrriippttiioonn + SIGHUP terminate process terminal line hangup + SIGINT terminate process interrupt program + SIGQUIT create core image quit program + SIGILL create core image illegal instruction + SIGTRAP create core image trace trap + SIGABRT create core image abort(2) call (formerly SIGIOT) + SIGEMT create core image emulate instruction executed + SIGFPE create core image floating-point exception + SIGKILL terminate process kill program + SIGBUS create core image bus error + SIGSEGV create core image segmentation violation + SIGSYS create core image system call given invalid + argument + SIGPIPE terminate process write on a pipe with no reader + SIGALRM terminate process real-time timer expired + SIGTERM terminate process software termination signal + SIGURG discard signal urgent condition present on + socket + SIGSTOP stop process stop (cannot be caught or + ignored) + SIGTSTP stop process stop signal generated from + keyboard + SIGCONT discard signal continue after stop + SIGCHLD discard signal child status has changed + SIGTTIN stop process background read attempted from + control terminal + SIGTTOU stop process background write attempted to + + + control terminal + SIGIO discard signal I/O is possible on a descriptor + (see fcntl(2)) + SIGXCPU terminate process cpu time limit exceeded (see + setrlimit(2)) + SIGXFSZ terminate process file size limit exceeded (see + setrlimit(2)) + SIGVTALRM terminate process virtual time alarm (see + setitimer(2)) + SIGPROF terminate process profiling timer alarm (see + setitimer(2)) + SIGWINCH discard signal Window size change + SIGINFO discard signal status request from keyboard + SIGUSR1 terminate process User defined signal 1 + SIGUSR2 terminate process User defined signal 2 + + The _f_u_n_c procedure allows a user to choose the action upon receipt of a + signal. To set the default action of the signal to occur as listed + above, _f_u_n_c should be SIG_DFL. A SIG_DFL resets the default action. To + ignore the signal _f_u_n_c should be SIG_IGN. This will cause subsequent in- + stances of the signal to be ignored and pending instances to be discard- + ed. If SIG_IGN is not used, further occurrences of the signal are auto- + matically blocked and _f_u_n_c is called. + + The handled signal is unblocked with the function returns and the process + continues from where it left off when the signal occured. UUnnlliikkee pprreevvii-- + oouuss ssiiggnnaall ffaacciilliittiieess,, tthhee hhaannddlleerr ffuunncc(()) rreemmaaiinnss iinnssttaalllleedd aafftteerr aa ssiigg-- + nnaall hhaass bbeeeenn ddeelliivveerreedd.. + + For some system calls, if a signal is caught while the call is executing + and the call is permaturely terminated, the call is automatically + restarted. (The handler is installed using the SA_RESTART flag with + sigaction(2).) The affected system calls include read(2), write(2), + sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications + channel or a low speed device and during a ioctl(2) or wait(2). However, + calls that have already committed are not restarted, but instead return a + partial success (for example, a short read count). + + When a process which has installed signal handlers forks, the child pro- + cess inherits the signals. All caught signals may be reset to their de- + fault action by a call to the execve(2) function; ignored signals remain + ignored. + +RREETTUURRNN VVAALLUUEESS + The previous action is returned on a successful call. Otherwise, -1 is + returned and the global variable _e_r_r_n_o is set to indicate the error. + +EERRRROORRSS + Signal will fail and no action will take place if one of the following + occur: + + [EINVAL] _S_i_g is not a valid signal number. + + [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or + SIGSTOP. + +SSEEEE AALLSSOO + kill(1), ptrace(2), kill(2), sigaction(2), sigaltstack(2), + sigprocmask(2), sigsuspend(2), setjmp(3), tty(4) + +HHIISSTTOORRYY + This ssiiggnnaall facility appeared in 4.0BSD. + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/sigsetjmp.0 b/usr/share/man/cat3/sigsetjmp.0 new file mode 100644 index 0000000000..29fbe4fe5c --- /dev/null +++ b/usr/share/man/cat3/sigsetjmp.0 @@ -0,0 +1,79 @@ +SETJMP(3) BSD Programmer's Manual SETJMP(3) + +NNAAMMEE + ssiiggsseettjjmmpp, ssiigglloonnggjjmmpp, sseettjjmmpp, lloonnggjjmmpp, __sseettjjmmpp, __lloonnggjjmmpp lloonnggjjmmppeerrrroorr - + non-local jumps + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssiiggsseettjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _s_a_v_e_m_a_s_k); + + _v_o_i_d + ssiigglloonnggjjmmpp(_s_i_g_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _i_n_t + __sseettjjmmpp(_j_m_p___b_u_f _e_n_v); + + _v_o_i_d + __lloonnggjjmmpp(_j_m_p___b_u_f _e_n_v, _i_n_t _v_a_l); + + _v_o_i_d + lloonnggjjmmppeerrrroorr(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ssiiggsseettjjmmpp(), sseettjjmmpp(), and __sseettjjmmpp() functions save their calling en- + vironment in _e_n_v. Each of these functions returns 0. + + The corresponding lloonnggjjmmpp() functions restore the environment saved by + their most recent respective invocations of the sseettjjmmpp() function. They + then return so that program execution continues as if the corresponding + invocation of the sseettjjmmpp() call had just returned the value specified by + _v_a_l, instead of 0. + + Pairs of calls may be intermixed, i.e. both ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() + and sseettjjmmpp() and lloonnggjjmmpp() combinations may be used in the same program, + however, individual calls may not, e.g. the _e_n_v argument to sseettjjmmpp() may + not be passed to ssiigglloonnggjjmmpp(). + + The lloonnggjjmmpp() routines may not be called after the routine which called + the sseettjjmmpp() routines returns. + + All accessible objects have values as of the time lloonnggjjmmpp() routine was + called, except that the values of objects of automatic storage invocation + duration that do not have the _v_o_l_a_t_i_l_e type and have been changed between + the sseettjjmmpp() invocation and lloonnggjjmmpp() call are indeterminate. + + The sseettjjmmpp()/lloonnggjjmmpp() pairs save and restore the signal mask while + __sseettjjmmpp()/__lloonnggjjmmpp() pairs save and restore only the register set and the + stack. (See ssiiggmmaasskk(_2).) + + The ssiiggsseettjjmmpp()/ssiigglloonnggjjmmpp() function pairs save and restore the signal + mask if the argument _s_a_v_e_m_a_s_k is non-zero, otherwise only the register + set and the stack are saved. + +EERRRROORRSS + If the contents of the _e_n_v are corrupted, or correspond to an environment + that has already returned, the lloonnggjjmmpp() routine calls the routine + lloonnggjjmmppeerrrroorr(_3). If lloonnggjjmmppeerrrroorr() returns the program is aborted (see + abort(2)). The default version of lloonnggjjmmppeerrrroorr() prints the message + ``longjmp botch'' to standard error and returns. User programs wishing + to exit more gracefully should write their own versions of + lloonnggjjmmppeerrrroorr(). + +SSEEEE AALLSSOO + sigaction(2), sigaltstack(2), signal(3) + +SSTTAANNDDAARRDDSS + The sseettjjmmpp() and lloonnggjjmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). The ssiiggsseettjjmmpp() and ssiigglloonnggjjmmpp() functions conform to IEEE + Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/sigsetops.0 b/usr/share/man/cat3/sigsetops.0 new file mode 100644 index 0000000000..ed9483c78d --- /dev/null +++ b/usr/share/man/cat3/sigsetops.0 @@ -0,0 +1,56 @@ +SIGSETOPS(3) BSD Programmer's Manual SIGSETOPS(3) + +NNAAMMEE + ssiiggeemmppttyysseett, ssiiggffiillllsseett, ssiiggaaddddsseett, ssiiggddeellsseett, ssiiggiissmmeemmbbeerr - manipulate + signal sets + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + ssiiggeemmppttyysseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggffiillllsseett(_s_i_g_s_e_t___t _*_s_e_t); + + ssiiggaaddddsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggddeellsseett(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + + ssiiggiissmmeemmbbeerr(_s_i_g_s_e_t___t _*_s_e_t, _i_n_t _s_i_g_n_o); + +DDEESSCCRRIIPPTTIIOONN + These functions manipulate signal sets stored in a _s_i_g_s_e_t___t. Either + ssiiggeemmppttyysseett() or ssiiggffiillllsseett() must be called for every object of type + _s_i_g_s_e_t___t before any other use of the object. + + The ssiiggeemmppttyysseett() function initializes a signal set to be empty. + + The ssiiggffiillllsseett() function initializes a signal set to contain all sig- + nals. + + The ssiiggaaddddsseett() function adds the specified signal _s_i_g_n_o to the signal + set. + + The ssiiggddeellsseett() function deletes the specified signal _s_i_g_n_o from the sig- + nal set. + + The ssiiggiissmmeemmbbeerr() function returns whether a specified signal _s_i_g_n_o is + contained in the signal set. + + These functions are provided as macros in the include file . + Actual functions are available if their names are undefined (with #undef + _n_a_m_e). + +RREETTUURRNN VVAALLUUEESS + The ssiiggiissmmeemmbbeerr() function returns 1 if the signal is a member of the + set, 0 otherwise. The other functions return 0. + +EERRRROORRSS + Currently no errors are detected. + +SSEEEE AALLSSOO + kill(2), sigaction(2), sigsuspend(2) + +SSTTAANNDDAARRDDSS + These functions are defined by IEEE Std1003.1-1988 (``POSIX''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sleep.0 b/usr/share/man/cat3/sleep.0 new file mode 100644 index 0000000000..0617da19f5 --- /dev/null +++ b/usr/share/man/cat3/sleep.0 @@ -0,0 +1,35 @@ +SLEEP(3) BSD Programmer's Manual SLEEP(3) + +NNAAMMEE + sslleeeepp - suspend process execution for interval of seconds + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___i_n_t + sslleeeepp(_u___i_n_t _s_e_c_o_n_d_s); + +DDEESSCCRRIIPPTTIIOONN + The sslleeeepp() function suspends execution of the calling process for + _s_e_c_o_n_d_s of time. System activity or time spent in processing the call + may lengthen the sleep by a second. + + If a timer is already running on the process its state is saved. If the + value _s_e_c_o_n_d_s is more than or equal to the remaining clock time for the + saved timer, the sleep time is set to the remaining clock time. The + state of the previous timer is restored after _s_e_c_o_n_d_s has passed. + + This function is implemented using setitimer(2); it requires eight sys- + tem calls each time it is invoked. A similar but less compatible func- + tion can be obtained with a single select(2); such a function would not + restart after signals, but would not interfere with other uses of + setitimer. + +RREETTUURRNN VVAALLUUEESS +SSEEEE AALLSSOO + setitimer(2), sigpause(2), usleep(3) + +HHIISSTTOORRYY + A sslleeeepp() function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/snprintf.0 b/usr/share/man/cat3/snprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/snprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/sprintf.0 b/usr/share/man/cat3/sprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/sprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/srand.0 b/usr/share/man/cat3/srand.0 new file mode 100644 index 0000000000..fc65f44397 --- /dev/null +++ b/usr/share/man/cat3/srand.0 @@ -0,0 +1,35 @@ +RAND(3) BSD Programmer's Manual RAND(3) + +NNAAMMEE + rraanndd, ssrraanndd - bad random number generator + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ssrraanndd(_u_n_s_i_g_n_e_d _s_e_e_d); + + _i_n_t + rraanndd(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + TThheessee iinntteerrffaacceess aarree oobbssoolleetteedd bbyy rraannddoomm((33)).. + + The rraanndd() function computes a sequence of pseudo-random integers in the + range of 0 to RAND_MAX (as defined by the header file <_s_t_d_l_i_b_._h>). + + The ssrraanndd() function sets its argument as the seed for a new sequence of + pseudo-random numbers to be returned by rraanndd(). These sequences are re- + peatable by calling ssrraanndd() with the same seed value. + + If no seed value is provided, the functions are automatically seeded with + a value of 1. + +SSEEEE AALLSSOO + random(3) + +SSTTAANNDDAARRDDSS + The rraanndd() and ssrraanndd() functions conform to ANSI C X3.159-1989 (``ANSI C + ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/srandom.0 b/usr/share/man/cat3/srandom.0 new file mode 100644 index 0000000000..20b591fdd7 --- /dev/null +++ b/usr/share/man/cat3/srandom.0 @@ -0,0 +1,89 @@ +RANDOM(3) BSD Programmer's Manual RANDOM(3) + +NNAAMMEE + rraannddoomm, ssrraannddoomm, iinniittssttaattee, sseettssttaattee - better random number generator; + routines for changing generators + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + rraannddoomm(_v_o_i_d); + + _v_o_i_d + ssrraannddoomm(_u_n_s_i_g_n_e_d _s_e_e_d); + + _c_h_a_r _* + iinniittssttaattee(_u_n_s_i_g_n_e_d _s_e_e_d, _c_h_a_r _*_s_t_a_t_e, _i_n_t _n); + + _c_h_a_r _* + sseettssttaattee(_c_h_a_r _*_s_t_a_t_e); + +DDEESSCCRRIIPPTTIIOONN + The rraannddoomm() function uses a non-linear 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 (2**31)-1. The + period of this random number generator is very large, approximately + 16*((2**31)-1). + + The rraannddoomm()/ ssrraannddoomm() have (almost) the same calling sequence and ini- + tialization properties as rand(3)/ srand(3). The difference is that + rand produces a much less random sequence -- in fact, the low dozen bits + generated by rand go through a cyclic pattern. All the bits generated by + rraannddoomm() are usable. For example, `random()&01' will produce a random + binary value. + + Unlike srand, ssrraannddoomm() does not return the old seed; the reason for + this is that the amount of state information used is much more than a + single word. (Two other routines are provided to deal with restart- + ing/changing random number generators). Like rand(3), however, rraannddoomm() + will by default produce a sequence of numbers that can be duplicated by + calling ssrraannddoomm() with `1' as the seed. + + The iinniittssttaattee() routine allows a state array, passed in as an argument, + to be initialized for future use. The size of the state array (in bytes) + is used by iinniittssttaattee() to decide how sophisticated a random number gener- + ator it should use -- the more state, the better the random numbers will + be. (Current "optimal" values for the amount of state information 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.) The + seed for the initialization (which specifies a starting point for the + random number sequence, and provides for restarting at the same point) is + also an argument. The iinniittssttaattee() function returns a pointer to the pre- + vious state information array. + + Once a state has been initialized, the sseettssttaattee() routine provides for + rapid switching between states. The sseettssttaattee() function returns a point- + er to the previous state array; its argument state array is used for fur- + ther random number generation until the next call to iinniittssttaattee() or + sseettssttaattee(). + + Once a state array has been initialized, it may be restarted at a differ- + ent point either by calling iinniittssttaattee() (with the desired seed, the state + array, and its size) or by calling both sseettssttaattee() (with the state array) + and ssrraannddoomm() (with the desired seed). The advantage of calling both + sseettssttaattee() and ssrraannddoomm() is that the size of the state array does not + have to be remembered after it is initialized. + + With 256 bytes of state information, the period of the random number gen- + erator is greater than 2**69 which should be sufficient for most purpos- + es. + +AAUUTTHHOORR + Earl T. Cohen + +DDIIAAGGNNOOSSTTIICCSS + If iinniittssttaattee() is called with less than 8 bytes of state information, or + if sseettssttaattee() detects that the state information has been garbled, error + messages are printed on the standard error output. + +SSEEEE AALLSSOO + rand(3) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +BBUUGGSS + About 2/3 the speed of rand(3). + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/sscanf.0 b/usr/share/man/cat3/sscanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/sscanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/stdio.0 b/usr/share/man/cat3/stdio.0 new file mode 100644 index 0000000000..0146008ec5 --- /dev/null +++ b/usr/share/man/cat3/stdio.0 @@ -0,0 +1,150 @@ +STDIO(3) BSD Programmer's Manual STDIO(3) + +NNAAMMEE + ssttddiioo - standard input/output library functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + FFIILLEE **ssttddiinn;; + FFIILLEE **ssttddoouutt;; + FFIILLEE **ssttddeerrrr;; + +DDEESSCCRRIIPPTTIIOONN + The standard I/O library provides a simple and efficient buffered stream + I/O interface. Input and ouput 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. + + A stream is associated with an external file (which may be a physical de- + vice) by _o_p_e_n_i_n_g 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 _f_i_l_e _p_o_s_i_t_i_o_n _i_n_d_i_c_a_t_o_r associated with the stream is + positioned at the start of the file (byte zero), unless the file is + opened with appened mode. If append mode is used, the position indicator + will be placed the end-of-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 fgetc(3) function; + all ouput takes place as if all characters were read by successive calls + to the fputc(3) function. + + A file is disassociated from a stream by _c_l_o_s_i_n_g the file. Ouput streams + are flushed (any unwritten buffer contents are transfered to the host en- + vironment) before the stream is disassociated from the file. The value + of a pointer to a FILE object is indeterminate after a file is closed + (garbage). + + A file may be subsequently reopened, by the same or another program exe- + cution, 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 exit(3) function is called, all open files are closed (hence all out- + put streams are flushed) before program termination. Other methods of + program termination, such as abort(3) do not bother about closing files + properly. + + At program startup, three text streams are predefined and need not be + opened explicitly -- _s_t_a_n_d_a_r_d _i_n_p_u_t (for reading converntional input), -- + _s_t_a_n_d_a_r_d _o_u_t_p_u_t (for writing converntional input), and _s_t_a_n_d_a_r_d _e_r_r_o_r + (for writing diagnostic output). These streams are abbreviated _s_t_d_i_n, + _s_t_d_o_u_t and _s_t_d_e_r_r. 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. + + 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 fflush(3) the standard output before + going off and computing so that the output will appear. + + The ssttddiioo library is a part of the library libc and routines are automat- + ically loaded as needed by the compilers cc(1) and 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. + + The following are defined as macros; these names may not be re-used with- + out first removing their current definitions with #undef: BUFSIZ, EOF, + FILENAME_MAX, L_cuserid, L_ctermid, L_tmpnam, NULL, SEEK_END, SEEK_SET, + SEE_CUR, TMP_MAX, clearerr, feof, ferror, fileno, fropen, fwopen, getc, + getchar, putc, putchar, stderr, stdin, stdout. Function versions of the + macro functions feof, ferror, clearerr, fileno, getc, getchar, + putc, and putchar exist and will be used if the macros definitions are + explicitly removed. + +SSEEEE AALLSSOO + open(2), close(2), read(2), write(2) + +BBUUGGSS + The standard buffered functions do not interact well with certain other + library and system functions, especially vfork and abort. + +SSTTAANNDDAARRDDSS + The ssttddiioo library conforms to ANSI C X3.159-1989 (``ANSI C ''). + +LLIISSTT OOFF FFUUNNCCTTIIOONNSS + FFuunnccttiioonn DDeessccrriippttiioonn + 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 + fgetline get a line from a stream + fgetpos reposition a stream + fgets get a line from a stream + fileno check and reset stream status + 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 + fropen open a stream + fscanf input format conversion + fseek reposition a stream + fsetpos reposition a stream + ftell reposition a stream + funopen open a stream + fwopen open 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 file name (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 + snprintf formatted output conversion + 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 + vsnprintf formatted output conversion + vsprintf formatted output conversion + vsscanf input format conversion + +4th Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/strcasecmp.0 b/usr/share/man/cat3/strcasecmp.0 new file mode 100644 index 0000000000..2fa92080ef --- /dev/null +++ b/usr/share/man/cat3/strcasecmp.0 @@ -0,0 +1,31 @@ +STRCASECMP(3) BSD Programmer's Manual STRCASECMP(3) + +NNAAMMEE + ssttrrccaasseeccmmpp - compare strings, ignoring case + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssttrrccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccaasseeccmmpp() and ssttrrnnccaasseeccmmpp() functions compare the null-terminated + strings _s_1 and _s_2 and return an integer greater than, equal to, or less + than 0, according as _s_1 is lexicographically greater than, equal to, or + less than _s_2 after translation of each corresponding character to lower- + case. The strings themselves are not modified. The comparison is done + using unsigned characters, so that `\200' is greater than `\0'. + + The ssttrrnnccaasseeccmmpp() compares at most _l_e_n characters. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcmp(3), strcoll(3), strxfrm(3) + +HHIISSTTOORRYY + The ssttrrccaasseeccmmpp() and ssttrrnnccaasseeccmmpp() functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/strcat.0 b/usr/share/man/cat3/strcat.0 new file mode 100644 index 0000000000..7e12d8718b --- /dev/null +++ b/usr/share/man/cat3/strcat.0 @@ -0,0 +1,33 @@ +STRCAT(3) BSD Programmer's Manual STRCAT(3) + +NNAAMMEE + ssttrrccaatt - concatenate strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_a_p_p_e_n_d); + + _c_h_a_r _* + ssttrrnnccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_a_p_p_e_n_d, _s_i_z_e___t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccaatt() and ssttrrnnccaatt() functions append a copy of the null-terminated + string _a_p_p_e_n_d to the end of the null-terminated string _s, then add a ter- + minating `\0'. The string _s must have sufficient space to hold the re- + sult. + + The ssttrrnnccaatt() function appends not more than _c_o_u_n_t characters. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccaatt() and ssttrrnnccaatt() functions return the pointer _s. + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memcpy(3), memmove(3), strcpy(3) + +SSTTAANNDDAARRDDSS + The ssttrrccaatt() and ssttrrnnccaatt() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strchr.0 b/usr/share/man/cat3/strchr.0 new file mode 100644 index 0000000000..573247819a --- /dev/null +++ b/usr/share/man/cat3/strchr.0 @@ -0,0 +1,28 @@ +STRCHR(3) BSD Programmer's Manual STRCHR(3) + +NNAAMMEE + ssttrrcchhrr - locate character in string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrcchhrr(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrcchhrr() function locates the first occurence of _c in the string + pointed to by _s. The terminating NULL character is considered part of the + string. If _c is `\0', ssttrrcchhrr() locates the terminating `\0'. + +RREETTUURRNN VVAALLUUEESS + The function ssttrrcchhrr() returns a pointer to the located character, or NULL + if the character does not appear in the string. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strcspn(3), strpbrk(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrcchhrr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strcmp.0 b/usr/share/man/cat3/strcmp.0 new file mode 100644 index 0000000000..f9ace9f985 --- /dev/null +++ b/usr/share/man/cat3/strcmp.0 @@ -0,0 +1,34 @@ +STRCMP(3) BSD Programmer's Manual STRCMP(3) + +NNAAMMEE + ssttrrccmmpp - compare strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssttrrccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccmmpp() and ssttrrnnccmmpp() functions lexicographically compare the null- + terminated strings _s_1 and _s_2. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccmmpp() and ssttrrnnccmmpp() return an integer greater than, equal to, or + less than 0, according as the string _s_1 is greater than, equal to, or + less than the string _s_2. The comparison is done using unsigned charac- + ters, so that `\200' is greater than `\0'. + + The ssttrrnnccmmpp() compares not more than _l_e_n characters. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strxfrm(3) + +SSTTAANNDDAARRDDSS + The ssttrrccmmpp() and ssttrrnnccmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strcoll.0 b/usr/share/man/cat3/strcoll.0 new file mode 100644 index 0000000000..d36a173445 --- /dev/null +++ b/usr/share/man/cat3/strcoll.0 @@ -0,0 +1,25 @@ +STRCOLL(3) BSD Programmer's Manual STRCOLL(3) + +NNAAMMEE + ssttrrccoollll - compare strings according to current collation + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssttrrccoollll(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccoollll() function lexicographically compares the null-terminated + strings _s_1 and _s_2 according to the current locale collation and returns + an integer greater than, equal to, or less than 0, according as _s_1 is + greater than, equal to, or less than _s_2. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), setlocale(3), strcasecmp(3), strcmp(3), + strxfrm(3) + +SSTTAANNDDAARRDDSS + The ssttrrccoollll() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strcpy.0 b/usr/share/man/cat3/strcpy.0 new file mode 100644 index 0000000000..236d923b77 --- /dev/null +++ b/usr/share/man/cat3/strcpy.0 @@ -0,0 +1,42 @@ +STRCPY(3) BSD Programmer's Manual STRCPY(3) + +NNAAMMEE + ssttrrccppyy - copy strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c); + + _c_h_a_r _* + ssttrrnnccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccppyy() and ssttrrnnccppyy() functions copy the string _s_r_c to _d_s_t (includ- + ing the terminating `\0' character). + + The ssttrrnnccppyy() copies not more than _l_e_n characters into _d_s_t, appending + `\0' characters if _s_r_c is less than _l_e_n characters long, and _n_o_t termi- + nating _d_s_t if _s_r_c is more than _l_e_n characters long. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccppyy() and ssttrrnnccppyy() functions return _d_s_t. + +EEXXAAMMPPLLEESS + The following sets ``chararray'' to ``abc\0\0\0'': + + (void)strncpy(chararray, "abc", 6). + + The following sets ``chararray'' to ``abcdef'': + + (void)strncpy(chararray, "abcdefgh", 6); + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memcpy(3), memmove(3) + +SSTTAANNDDAARRDDSS + The ssttrrccppyy() and ssttrrnnccppyy() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/strcspn.0 b/usr/share/man/cat3/strcspn.0 new file mode 100644 index 0000000000..daca7f317f --- /dev/null +++ b/usr/share/man/cat3/strcspn.0 @@ -0,0 +1,27 @@ +STRCSPN(3) BSD Programmer's Manual STRCSPN(3) + +NNAAMMEE + ssttrrccssppnn - span the complement of a string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_i_z_e___t + ssttrrccssppnn(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccssppnn() function spans the initial part of the null-terminated + string _s as long as the characters from _s do not occur in string _c_h_a_r_s_e_t + (it spans the _c_o_m_p_l_e_m_e_n_t of _c_h_a_r_s_e_t). + +RREETTUURRNN VVAALLUUEESS + The ssttrrccssppnn() function returns the number of characters spanned. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrccssppnn() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strdup.0 b/usr/share/man/cat3/strdup.0 new file mode 100644 index 0000000000..6c9f703662 --- /dev/null +++ b/usr/share/man/cat3/strdup.0 @@ -0,0 +1,25 @@ +STRDUP(3) BSD Programmer's Manual STRDUP(3) + +NNAAMMEE + ssttrrdduupp - save a copy of a string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrdduupp(_c_o_n_s_t _c_h_a_r _*_s_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrdduupp() function allocates sufficient memory for a copy of the + string _s_t_r, does the copy, and returns a pointer to it. The pointer may + subsequently be used as an argument to the function free(3). + + If insufficient memory is available, NULL is returned. + +SSEEEE AALLSSOO + malloc(3) free(3) + +HHIISSTTOORRYY + The ssttrrdduupp() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/strerror.0 b/usr/share/man/cat3/strerror.0 new file mode 100644 index 0000000000..32b9186a26 --- /dev/null +++ b/usr/share/man/cat3/strerror.0 @@ -0,0 +1,52 @@ +STRERROR(3) BSD Programmer's Manual STRERROR(3) + +NNAAMMEE + ppeerrrroorr, ssttrreerrrroorr, ssyyss__eerrrrlliisstt, ssyyss__nneerrrr - system error messages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ppeerrrroorr(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___e_r_r_l_i_s_t_[_]_; + _e_x_t_e_r_n _i_n_t _s_y_s___n_e_r_r_; + + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrreerrrroorr(_i_n_t _e_r_r_n_u_m); + +DDEESSCCRRIIPPTTIIOONN + The ssttrreerrrroorr() and ppeerrrroorr() functions look up the error message string + corresponding to an error number. + + The ssttrreerrrroorr() function accepts an error number argument _e_r_r_n_u_m and re- + turns a pointer to the corresponding message string. + + The ppeerrrroorr() function finds the error message corresponding to the cur- + rent value of the global variable _e_r_r_n_o (intro(2)) and writes it, fol- + lowed by a newline, to the standard error file descriptor. If the argu- + ment _s_t_r_i_n_g is non-NULL, it is prepended to the message string and sepa- + rated from it by a colon and space (`: '). If _s_t_r_i_n_g is NULL, only the + error message string is printed. + + If _e_r_r_n_u_m is not a recognized error number, the error message string will + contain ``Unknown error: '' followed by the error number in decimal. + + The message strings can be accessed directly using the external array + _s_y_s___e_r_r_l_i_s_t. The external value _s_y_s___n_e_r_r contains a count of the messages + in _s_y_s___e_r_r_l_i_s_t. The use of these variables is deprecated; ssttrreerrrroorr() + should be used instead. + +SSEEEE AALLSSOO + intro(2), psignal(3) + +HHIISSTTOORRYY + The ssttrreerrrroorr() and ppeerrrroorr() functions first appeared in 4.4BSD. + +BBUUGGSS + For unknown error numbers, the ssttrreerrrroorr() function will return its result + in a static buffer which may be overwritten by subsequent calls. + +4th Berkeley Distribution June 9, 1993 1 diff --git a/usr/share/man/cat3/strftime.0 b/usr/share/man/cat3/strftime.0 new file mode 100644 index 0000000000..9dc4d0e5a0 --- /dev/null +++ b/usr/share/man/cat3/strftime.0 @@ -0,0 +1,123 @@ +STRFTIME(3) BSD Programmer's Manual STRFTIME(3) + +NNAAMMEE + ssttrrffttiimmee - format date and time + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _s_i_z_e___t + ssttrrffttiimmee(_c_h_a_r _*_b_u_f, _s_i_z_e___t _m_a_x_s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, + _c_o_n_s_t _s_t_r_u_c_t _t_m _*_t_i_m_e_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrffttiimmee() function formats the information from _t_i_m_e_p_t_r into the + buffer _b_u_f according to the string pointed to by _f_o_r_m_a_t. + + The _f_o_r_m_a_t string consists of zero or more conversion specifications and + ordinary characters. All ordinary characters are copied directly into + the buffer. A conversion specification consists of a percent sign + ```%''' and one other character. + + No more than _m_a_x_s_i_z_e characters will be placed into the array. If the + total number of resulting characters, including the terminating null + character, is not more than _m_a_x_s_i_z_e, ssttrrffttiimmee() returns the number of + characters in the array, not counting the terminating null. Otherwise, + zero is returned. + + Each conversion specification is replaced by the characters as follows + which are then copied into the buffer. + + %%AA is replaced by the full weekday name. + + %%aa is replaced by the abbreviated weekday name, where the abbreviation + is the first three characters. + + %%BB is replaced by the full month name. + + %%bb oorr %%hh + is replaced by the abbreviated month name, where the abbreviation + is the first three characters. + + %%CC is equivalent to ``%a %b %e %H:%M:%S %Y'' (the format produced by + asctime(3). + + %%cc is equivalent to ``%m/%d/%y''. + + %%DD is replaced by the date in the format ```mm/dd/yy'''. + + %%dd is replaced by the day of the month as a decimal number (01-31). + + %%ee is replaced by the day of month as a decimal number (1-31); single + digits are preceded by a blank. + + %%HH is replaced by the hour (24-hour clock) as a decimal number + (00-23). + + %%II is replaced by the hour (12-hour clock) as a decimal number + (01-12). + + %%jj is replaced by the day of the year as a decimal number (001-366). + + %%kk is replaced by the hour (24-hour clock) as a decimal number (0-23); + + single digits are preceded by a blank. + + %%ll is replaced by the hour (12-hour clock) as a decimal number (1-12); + single digits are preceded by a blank. + + %%MM is replaced by the minute as a decimal number (00-59). + + %%mm is replaced by the month as a decimal number (01-12). + + %%nn is replaced by a newline. + + %%pp is replaced by either ``AM'' or ``PM'' as appropriate. + + %%RR is equivalent to ``%H:%M'' + + %%rr is equivalent to ``%I:%M:%S %p''. + + %%tt is replaced by a tab. + + %%SS is replaced by the second as a decimal number (00-60). + + %%ss is replaced by the number of seconds since the Epoch, UCT (see + mktime(3)). + + %%TT or %%XX + is equivalent to ``%H:%M:%S''. + + %%UU is replaced by the week number of the year (Sunday as the first day + of the week) as a decimal number (00-53). + + %%WW is replaced by the week number of the year (Monday as the first day + of the week) as a decimal number (00-53). + + %%ww is replaced by the weekday (Sunday as the first day of the week) as + a decimal number (0-6). + + %%xx is equivalent to ``%m/%d/%y %H:%M:%S''. + + %%YY is replaced by the year with century as a decimal number. + + %%yy is replaced by the year without century as a decimal number + (00-99). + + %%ZZ is replaced by the time zone name. + + %%%% is replaced by `%'. + +SSEEEE AALLSSOO + date(1), ctime(3), printf(1), printf(3) + +SSTTAANNDDAARRDDSS + The ssttrrffttiimmee() function conforms to ANSI C X3.159-1989 (``ANSI C ''). The + `%s' conversion specification is an extension. + +BBUUGGSS + There is no conversion specification for the phase of the moon. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/string.0 b/usr/share/man/cat3/string.0 new file mode 100644 index 0000000000..616509e0aa --- /dev/null +++ b/usr/share/man/cat3/string.0 @@ -0,0 +1,95 @@ +STRING(3) BSD Programmer's Manual STRING(3) + +NNAAMMEE + ssttrrccaatt, ssttrrnnccaatt, ssttrrcchhrr, ssttrrrrcchhrr, ssttrrccmmpp, ssttrrnnccmmpp, ssttrrccaasseeccmmpp,, + ssttrrnnccaasseeccmmpp, ssttrrccppyy, ssttrrnnccppyy, ssttrreerrrroorr, ssttrrlleenn, ssttrrppbbrrkk, ssttrrsseepp,, ssttrrssppnn, + ssttrrccssppnn, ssttrrssttrr, ssttrrttookk, iinnddeexx, rriinnddeexx - string specific functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _* _a_p_p_e_n_d); + + _c_h_a_r _* + ssttrrnnccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_a_p_p_e_n_d, _s_i_z_e___t _c_o_u_n_t); + + _c_h_a_r _* + ssttrrcchhrr(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + + _c_h_a_r _* + ssttrrrrcchhrr(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + + _i_n_t + ssttrrccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _c_o_u_n_t); + + _i_n_t + ssttrrccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _c_o_u_n_t); + + _c_h_a_r _* + ssttrrccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c); + + _c_h_a_r _* + ssttrrnnccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c, _s_i_z_e___t _c_o_u_n_t); + + _c_h_a_r _* + ssttrreerrrroorr(_i_n_t _e_r_r_n_o); + + _s_i_z_e___t + ssttrrlleenn(_c_o_n_s_t _c_h_a_r _*_s); + + _c_h_a_r _* + ssttrrppbbrrkk(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + + _c_h_a_r _* + ssttrrsseepp(_c_h_a_r _*_*_s_t_r_i_n_g_p, _c_o_n_s_t _c_h_a_r _*_d_e_l_i_m); + + _s_i_z_e___t + ssttrrssppnn(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + + _s_i_z_e___t + ssttrrccssppnn(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + + _c_h_a_r _* + ssttrrssttrr(_c_o_n_s_t _c_h_a_r _*_b_i_g, _c_o_n_s_t _c_h_a_r _*_l_i_t_t_l_e); + + _c_h_a_r _* + ssttrrttookk(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_d_e_l_i_m); + + + _c_h_a_r _* + iinnddeexx(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + + _c_h_a_r _* + rriinnddeexx(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The string functions functions manipulate strings terminated by a null + byte. + + See the specific manual pages for more information. For manipulating + variable length generic objects as byte strings (without the null byte + check), see bstring(3). + + Except as noted in their specific manual pages, the string functions do + not test the destination for size limitations. + +SSEEEE AALLSSOO + index(3), strcat(3), strchr(3), strrchr(3), strcmp(3), + strcasecmp(3), strcpy(3), strerror(3), strlen(3), strpbrk(3), + strsep(3), strspn(3), strcspn(3), strstr(3), strtok(3), rindex(3) + bstring(3) + +SSTTAANNDDAARRDDSS + The ssttrrccaatt(), ssttrrnnccaatt(), ssttrrcchhrr(), ssttrrrrcchhrr(), ssttrrccmmpp(), ssttrrnnccmmpp(), + ssttrrccppyy(), ssttrrnnccppyy(), ssttrreerrrroorr(), ssttrrlleenn(), ssttrrppbbrrkk(), ssttrrsseepp(), ssttrrssppnn(), + ssttrrccssppnn(), ssttrrssttrr(), and ssttrrttookk() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4th Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/strlen.0 b/usr/share/man/cat3/strlen.0 new file mode 100644 index 0000000000..6fc234b8d3 --- /dev/null +++ b/usr/share/man/cat3/strlen.0 @@ -0,0 +1,25 @@ +STRLEN(3) BSD Programmer's Manual STRLEN(3) + +NNAAMMEE + ssttrrlleenn - find length of string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_i_z_e___t + ssttrrlleenn(_c_o_n_s_t _c_h_a_r _*_s); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrlleenn() function computes the length of the string _s. + +RREETTUURRNN VVAALLUUEESS + The ssttrrlleenn() function returns the number of characters that precede the + terminating NUL character. + +SSEEEE AALLSSOO + string(3) + +SSTTAANNDDAARRDDSS + The ssttrrlleenn() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strmode.0 b/usr/share/man/cat3/strmode.0 new file mode 100644 index 0000000000..bde061d8c6 --- /dev/null +++ b/usr/share/man/cat3/strmode.0 @@ -0,0 +1,90 @@ +STRMODE(3) BSD Programmer's Manual STRMODE(3) + +NNAAMMEE + ssttrrmmooddee - convert inode status information into a symbolic string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ssttrrmmooddee(_m_o_d_e___t _m_o_d_e, _c_h_a_r _*_b_p); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrmmooddee() function converts a file _m_o_d_e (the type and permission in- + formation associated with an inode, see stat(2)) into a symbolic string + which is stored in the location referenced by _b_p. This stored string is + eleven characters in length plus a trailing NULL. + + The first character is the inode type, and will be one of the following: + + - regular file + b block special + c character special + d directory + l symbolic link + p fifo + s socket + ? unknown inode type + + The next nine characters encode three sets of permissions, in three char- + acters each. The first three characters are the permissions for the own- + er of the file, the second three for the group the file belongs to, and + the third for the ``other'', or default, set of users. + + Permission checking is done as specifically as possible. If read permis- + sion is denied to the owner of a file in the first set of permssions, the + owner of the file will not be able to read the file. This is true even + if the owner is in the file's group and the group permissions allow read- + ing or the ``other'' permissions allow reading. + + If the first character of the three character set is an ``r'', the file + is readable for that set of users; if a dash ``-'', it is not readable. + + If the second character of the three character set is a ``w'', the file + is writable for that set of users; if a dash ``-'', it is not writable. + + The third character is the first of the following characters that apply: + + S If the character is part of the owner permissions and the file is + not executable or the directory is not searchable, by the owner, + and the set-user-id bit is set. + + S If the character is part of the group permissions and the file is + not executable or the directory is not searchable, by the group, + and the set-group-id bit is set. + + T If the character is part of the other permissions and the file is + not executable or the directory is not searchable, by others, and + the ``sticky'' (S_ISVTX) bit is set. + + s If the character is part of the owner permissions and the file is + executable or the directory searchable, by the owner, and the set- + user-id bit is set. + + s If the character is part of the group permissions and the file is + executable or the directory searchable, by the group, and the set- + + group-id bit is set. + + t If the character is part of the other permissions and the file is + executable or the directory searchable, by others, and the + ``sticky'' (S_ISVTX) bit is set. + + x The file is executable or the directory is searchable. + + - None of the above apply. + + The last character is a plus sign ``+'' if any there are any alternate or + additional access control methods associated with the inode, otherwise it + will be a space. + +RREETTUURRNN VVAALLUUEESS + The ssttrrmmooddee() function always returns 0. + +SSEEEE AALLSSOO + chmod(1), find(1), stat(2), getmode(3), setmode(3) + +HHIISSTTOORRYY + The ssttrrmmooddee() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/strncasecmp.0 b/usr/share/man/cat3/strncasecmp.0 new file mode 100644 index 0000000000..2fa92080ef --- /dev/null +++ b/usr/share/man/cat3/strncasecmp.0 @@ -0,0 +1,31 @@ +STRCASECMP(3) BSD Programmer's Manual STRCASECMP(3) + +NNAAMMEE + ssttrrccaasseeccmmpp - compare strings, ignoring case + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssttrrccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccaasseeccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccaasseeccmmpp() and ssttrrnnccaasseeccmmpp() functions compare the null-terminated + strings _s_1 and _s_2 and return an integer greater than, equal to, or less + than 0, according as _s_1 is lexicographically greater than, equal to, or + less than _s_2 after translation of each corresponding character to lower- + case. The strings themselves are not modified. The comparison is done + using unsigned characters, so that `\200' is greater than `\0'. + + The ssttrrnnccaasseeccmmpp() compares at most _l_e_n characters. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcmp(3), strcoll(3), strxfrm(3) + +HHIISSTTOORRYY + The ssttrrccaasseeccmmpp() and ssttrrnnccaasseeccmmpp() functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/strncat.0 b/usr/share/man/cat3/strncat.0 new file mode 100644 index 0000000000..7e12d8718b --- /dev/null +++ b/usr/share/man/cat3/strncat.0 @@ -0,0 +1,33 @@ +STRCAT(3) BSD Programmer's Manual STRCAT(3) + +NNAAMMEE + ssttrrccaatt - concatenate strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_a_p_p_e_n_d); + + _c_h_a_r _* + ssttrrnnccaatt(_c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_a_p_p_e_n_d, _s_i_z_e___t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccaatt() and ssttrrnnccaatt() functions append a copy of the null-terminated + string _a_p_p_e_n_d to the end of the null-terminated string _s, then add a ter- + minating `\0'. The string _s must have sufficient space to hold the re- + sult. + + The ssttrrnnccaatt() function appends not more than _c_o_u_n_t characters. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccaatt() and ssttrrnnccaatt() functions return the pointer _s. + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memcpy(3), memmove(3), strcpy(3) + +SSTTAANNDDAARRDDSS + The ssttrrccaatt() and ssttrrnnccaatt() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strncmp.0 b/usr/share/man/cat3/strncmp.0 new file mode 100644 index 0000000000..f9ace9f985 --- /dev/null +++ b/usr/share/man/cat3/strncmp.0 @@ -0,0 +1,34 @@ +STRCMP(3) BSD Programmer's Manual STRCMP(3) + +NNAAMMEE + ssttrrccmmpp - compare strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssttrrccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2); + + _i_n_t + ssttrrnnccmmpp(_c_o_n_s_t _c_h_a_r _*_s_1, _c_o_n_s_t _c_h_a_r _*_s_2, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccmmpp() and ssttrrnnccmmpp() functions lexicographically compare the null- + terminated strings _s_1 and _s_2. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccmmpp() and ssttrrnnccmmpp() return an integer greater than, equal to, or + less than 0, according as the string _s_1 is greater than, equal to, or + less than the string _s_2. The comparison is done using unsigned charac- + ters, so that `\200' is greater than `\0'. + + The ssttrrnnccmmpp() compares not more than _l_e_n characters. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcasecmp(3), strcoll(3), strxfrm(3) + +SSTTAANNDDAARRDDSS + The ssttrrccmmpp() and ssttrrnnccmmpp() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strncpy.0 b/usr/share/man/cat3/strncpy.0 new file mode 100644 index 0000000000..236d923b77 --- /dev/null +++ b/usr/share/man/cat3/strncpy.0 @@ -0,0 +1,42 @@ +STRCPY(3) BSD Programmer's Manual STRCPY(3) + +NNAAMMEE + ssttrrccppyy - copy strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c); + + _c_h_a_r _* + ssttrrnnccppyy(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccppyy() and ssttrrnnccppyy() functions copy the string _s_r_c to _d_s_t (includ- + ing the terminating `\0' character). + + The ssttrrnnccppyy() copies not more than _l_e_n characters into _d_s_t, appending + `\0' characters if _s_r_c is less than _l_e_n characters long, and _n_o_t termi- + nating _d_s_t if _s_r_c is more than _l_e_n characters long. + +RREETTUURRNN VVAALLUUEESS + The ssttrrccppyy() and ssttrrnnccppyy() functions return _d_s_t. + +EEXXAAMMPPLLEESS + The following sets ``chararray'' to ``abc\0\0\0'': + + (void)strncpy(chararray, "abc", 6). + + The following sets ``chararray'' to ``abcdef'': + + (void)strncpy(chararray, "abcdefgh", 6); + +SSEEEE AALLSSOO + bcopy(3), memccpy(3), memcpy(3), memmove(3) + +SSTTAANNDDAARRDDSS + The ssttrrccppyy() and ssttrrnnccppyy() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/strpbrk.0 b/usr/share/man/cat3/strpbrk.0 new file mode 100644 index 0000000000..730f588a00 --- /dev/null +++ b/usr/share/man/cat3/strpbrk.0 @@ -0,0 +1,25 @@ +STRPBRK(3) BSD Programmer's Manual STRPBRK(3) + +NNAAMMEE + ssttrrppbbrrkk - locate multiple characters in string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrppbbrrkk(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrppbbrrkk() function locates in the null-terminated string _s the first + occurrence of any character in the string _c_h_a_r_s_e_t and returns a pointer + to this character. If no characters from _c_h_a_r_s_e_t occur anywhere in _s + ssttrrppbbrrkk() returns NULL. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strrchr(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrppbbrrkk() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strrchr.0 b/usr/share/man/cat3/strrchr.0 new file mode 100644 index 0000000000..eba45bb4ea --- /dev/null +++ b/usr/share/man/cat3/strrchr.0 @@ -0,0 +1,28 @@ +STRRCHR(3) BSD Programmer's Manual STRRCHR(3) + +NNAAMMEE + ssttrrrrcchhrr - locate character in string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrrrcchhrr(_c_o_n_s_t _c_h_a_r _*_s, _i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrrrcchhrr() function locates the last occurrence of _c (converted to a + char) in the string _s. If _c is `\0', ssttrrrrcchhrr() locates the terminating + `\0'. + +RREETTUURRNN VVAALLUUEESS + The ssttrrrrcchhrr() function returns a pointer to the character, or a null + pointer if _c does not occur anywhere in _s. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), + strsep(3), strspn(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrrrcchhrr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strsep.0 b/usr/share/man/cat3/strsep.0 new file mode 100644 index 0000000000..215e5c7dae --- /dev/null +++ b/usr/share/man/cat3/strsep.0 @@ -0,0 +1,44 @@ +STRSEP(3) BSD Programmer's Manual STRSEP(3) + +NNAAMMEE + ssttrrsseepp - separate strings + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrsseepp(_c_h_a_r _*_*_s_t_r_i_n_g_p, _c_h_a_r _*_d_e_l_i_m); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrsseepp() function locates, in the string referenced by _*_s_t_r_i_n_g_p, the + first occurrence of any character in the string _d_e_l_i_m (or the terminating + `\0' character) and replaces it with a `\0'. The location of the next + character after the delimiter character (or NULL, if the end of the + string was reached) is stored in _*_s_t_r_i_n_g_p. The original value of _*_s_t_r_i_n_g_p + is returned. + + An ``empty'' field, i.e. one caused by two adjacent delimiter characters, + can be detected by comparing the location referenced by the pointer re- + turned in _*_s_t_r_i_n_g_p to `\0'. + + If _*_s_t_r_i_n_g_p is initially NULL, ssttrrsseepp() returns NULL. + +EEXXAAMMPPLLEESS + The following uses ssttrrsseepp() to parse a string, containing tokens delimit- + ed by white space, into an argument vector: + + char **ap, *argv[10], *inputstring; + + for (ap = argv; (*ap = strsep(&inputstring, " \t")) != NULL;) + if (**ap != '\0') + ++ap; + +HHIISSTTOORRYY + The ssttrrsseepp() function is intended as a replacement for the ssttrrttookk() func- + tion. While the ssttrrttookk() function should be preferred for portability + reasons (it conforms to ANSI C X3.159-1989 (``ANSI C '')) it is unable to + handle empty fields, i.e. detect fields delimited by two adjacent delim- + iter characters, or to be used for more than a single string at a time. + The ssttrrsseepp() function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/strspn.0 b/usr/share/man/cat3/strspn.0 new file mode 100644 index 0000000000..3cc98b75a1 --- /dev/null +++ b/usr/share/man/cat3/strspn.0 @@ -0,0 +1,26 @@ +STRSPN(3) BSD Programmer's Manual STRSPN(3) + +NNAAMMEE + ssttrrssppnn - span a string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_i_z_e___t + ssttrrssppnn(_c_o_n_s_t _c_h_a_r _*_s, _c_o_n_s_t _c_h_a_r _*_c_h_a_r_s_e_t); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrccssppnn() function spans the initial part of the null-terminated + string _s as long as the characters from _s occur in string _c_h_a_r_s_e_t. + +RREETTUURRNN VVAALLUUEESS + The ssttrrssppnn() function returns the number of characters spanned. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), + strrchr(3), strsep(3), strstr(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrssppnn() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strstr.0 b/usr/share/man/cat3/strstr.0 new file mode 100644 index 0000000000..fa85f19e08 --- /dev/null +++ b/usr/share/man/cat3/strstr.0 @@ -0,0 +1,26 @@ +STRSTR(3) BSD Programmer's Manual STRSTR(3) + +NNAAMMEE + ssttrrssttrr - locate a substring in a string + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrssttrr(_c_o_n_s_t _c_h_a_r _*_b_i_g, _c_o_n_s_t _c_h_a_r _*_l_i_t_t_l_e); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrssttrr() function locates the first occurrence of the null-terminated + string _l_i_t_t_l_e in the null-terminated string _b_i_g. If _l_i_t_t_l_e is the empty + string, ssttrrssttrr() returns _b_i_g; if _l_i_t_t_l_e occurs nowhere in _b_i_g, ssttrrssttrr() + returns NULL; otherwise ssttrrssttrr() returns a pointer to the first character + of the first occurrence of _l_i_t_t_l_e. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), + strrchr(3), strsep(3), strspn(3), strtok(3) + +SSTTAANNDDAARRDDSS + The ssttrrssttrr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strtod.0 b/usr/share/man/cat3/strtod.0 new file mode 100644 index 0000000000..886e16e6dc --- /dev/null +++ b/usr/share/man/cat3/strtod.0 @@ -0,0 +1,69 @@ +STRTOD(3) BSD Programmer's Manual STRTOD(3) + +NNAAMMEE + ssttrrttoodd - convert ASCII string to double + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _d_o_u_b_l_e + ssttrrttoodd(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrttoodd() function converts the initial portion of the string pointed + to by _n_p_t_r to _d_o_u_b_l_e representation. + + The expected form of the string is an optional plus (``+'') or minus sign + (``-'') followed by a sequence of digits optionally containing a decimal- + point character, optionally followed by an exponent. An exponent con- + sists of an ``E'' or ``e'', followed by an optional plus or minus sign, + followed by a sequence of digits. + + Leading white-space characters in the string (as defined by the iss- + pace(3) function) are skipped. + +RREETTUURRNN VVAALLUUEESS + The ssttrrttoodd() function returns the converted value, if any. + + If _e_n_d_p_t_r is not NULL, a pointer to the character after the last charac- + ter used in the conversion is stored in the location referenced by + _e_n_d_p_t_r. + + If no conversion is performed, zero is returned and the value of _n_p_t_r is + stored in the location referenced by _e_n_d_p_t_r. + + If the correct value would cause overflow, plus or minus HUGE_VAL is re- + turned (according to the sign of the value), and ERANGE is stored in + _e_r_r_n_o. If the correct value would cause underflow, zero is returned and + ERANGE is stored in _e_r_r_n_o. + +EERRRROORRSS + [ERANGE] Overflow or underflow occurred. + +SSEEEE AALLSSOO + atof(3), atoi(3), atol(3), strtol(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The ssttrrttoodd() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +AAUUTTHHOORRSS + The author of this software is David M. Gay. + + Copyright (c) 1991 by AT&T. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy or + modification of this software and in all copies of the supporting docu- + mentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESEN- + TATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS + SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + + Contact your vendor for a free copy of the source code to ssttrrttoodd() and + accompanying functions. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/strtok.0 b/usr/share/man/cat3/strtok.0 new file mode 100644 index 0000000000..0e9eca8533 --- /dev/null +++ b/usr/share/man/cat3/strtok.0 @@ -0,0 +1,43 @@ +STRTOK(3) BSD Programmer's Manual STRTOK(3) + +NNAAMMEE + ssttrrttookk, ssttrrsseepp - string token operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ssttrrttookk(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_s_e_p); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ssttrrsseepp((33)).. + + The ssttrrttookk() function is used to isolate sequential tokens in a null- + terminated string, _s_t_r. These tokens are separated in the string by at + least one of the characters in _s_e_p. The first time that ssttrrttookk() is + called, _s_t_r should be specified; subsequent calls, wishing to obtain fur- + ther tokens from the same string, should pass a null pointer instead. + The separator string, _s_e_p, must be supplied each time, and may change be- + tween calls. + + The ssttrrttookk() function returns a pointer to the beginning of each subse- + quent token in the string, after replacing the token itself with a NUL + character. When no more tokens remain, a null pointer is returned. + +SSEEEE AALLSSOO + index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), + strrchr(3), strsep(3), strspn(3), strstr(3) + +SSTTAANNDDAARRDDSS + The ssttrrttookk() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + There is no way to get tokens from multiple strings simultaneously. + + The System V ssttrrttookk(), if handed a string containing only delimiter char- + acters, will not alter the next starting point, so that a call to + ssttrrttookk() with a different (or empty) delimiter string may return a non- + NULL value. Since this implementation always alters the next starting + point, such a sequence of calls would always return NULL. + +3rd Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/strtol.0 b/usr/share/man/cat3/strtol.0 new file mode 100644 index 0000000000..c4cbaa66e3 --- /dev/null +++ b/usr/share/man/cat3/strtol.0 @@ -0,0 +1,64 @@ +STRTOL(3) BSD Programmer's Manual STRTOL(3) + +NNAAMMEE + ssttrrttooll,, ssttrrttooqq - convert string value to a long or quad_t integer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _l_o_n_g + ssttrrttooll(_c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + + + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _q_u_a_d___t + ssttrrttooqq(_c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrttooll() function converts the string in _n_p_t_r to a _l_o_n_g value. The + ssttrrttooqq() function converts the string in _n_p_t_r to a _q_u_a_d___t value. The + conversion is done according to the given _b_a_s_e, which must be between 2 + and 36 inclusive, or be the special value 0. + + The string may begin with an arbitrary amount of white space (as deter- + mined by isspace(3)) followed by a single optional `+' or `-' sign. If + _b_a_s_e is zero or 16, the string may then include a `0x' prefix, and the + number will be read in base 16; otherwise, a zero _b_a_s_e is taken as 10 + (decimal) unless the next character is `0', in which case it is taken as + 8 (octal). + + The remainder of the string is converted to a _l_o_n_g 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 `A' in either upper or lower + case represents 10, `B' represents 11, and so forth, with `Z' represent- + ing 35.) + + If _e_n_d_p_t_r is non nil, ssttrrttooll() stores the address of the first invalid + character in _*_e_n_d_p_t_r. If there were no digits at all, however, ssttrrttooll() + stores the original value of _n_p_t_r in _*_e_n_d_p_t_r. (Thus, if _*_n_p_t_r is not `\0' + but _*_*_e_n_d_p_t_r is `\0' on return, the entire string was valid.) + +RREETTUURRNN VVAALLUUEESS + The ssttrrttooll() function returns the result of the conversion, unless the + value would underflow or overflow. If an underflow occurs, ssttrrttooll() re- + turns LONG_MIN. If an overflow occurs, ssttrrttooll() returns LONG_MAX. In both + cases, _e_r_r_n_o is set to ERANGE. + +EERRRROORRSS + [ERANGE] The given string was out of range; the value converted has been + clamped. + +SSEEEE AALLSSOO + atof(3), atoi(3), atol(3), strtod(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The ssttrrttooll() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + Ignores the current locale. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strtoq.0 b/usr/share/man/cat3/strtoq.0 new file mode 100644 index 0000000000..c4cbaa66e3 --- /dev/null +++ b/usr/share/man/cat3/strtoq.0 @@ -0,0 +1,64 @@ +STRTOL(3) BSD Programmer's Manual STRTOL(3) + +NNAAMMEE + ssttrrttooll,, ssttrrttooqq - convert string value to a long or quad_t integer + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _l_o_n_g + ssttrrttooll(_c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + + + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _q_u_a_d___t + ssttrrttooqq(_c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrttooll() function converts the string in _n_p_t_r to a _l_o_n_g value. The + ssttrrttooqq() function converts the string in _n_p_t_r to a _q_u_a_d___t value. The + conversion is done according to the given _b_a_s_e, which must be between 2 + and 36 inclusive, or be the special value 0. + + The string may begin with an arbitrary amount of white space (as deter- + mined by isspace(3)) followed by a single optional `+' or `-' sign. If + _b_a_s_e is zero or 16, the string may then include a `0x' prefix, and the + number will be read in base 16; otherwise, a zero _b_a_s_e is taken as 10 + (decimal) unless the next character is `0', in which case it is taken as + 8 (octal). + + The remainder of the string is converted to a _l_o_n_g 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 `A' in either upper or lower + case represents 10, `B' represents 11, and so forth, with `Z' represent- + ing 35.) + + If _e_n_d_p_t_r is non nil, ssttrrttooll() stores the address of the first invalid + character in _*_e_n_d_p_t_r. If there were no digits at all, however, ssttrrttooll() + stores the original value of _n_p_t_r in _*_e_n_d_p_t_r. (Thus, if _*_n_p_t_r is not `\0' + but _*_*_e_n_d_p_t_r is `\0' on return, the entire string was valid.) + +RREETTUURRNN VVAALLUUEESS + The ssttrrttooll() function returns the result of the conversion, unless the + value would underflow or overflow. If an underflow occurs, ssttrrttooll() re- + turns LONG_MIN. If an overflow occurs, ssttrrttooll() returns LONG_MAX. In both + cases, _e_r_r_n_o is set to ERANGE. + +EERRRROORRSS + [ERANGE] The given string was out of range; the value converted has been + clamped. + +SSEEEE AALLSSOO + atof(3), atoi(3), atol(3), strtod(3), strtoul(3) + +SSTTAANNDDAARRDDSS + The ssttrrttooll() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + Ignores the current locale. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strtoul.0 b/usr/share/man/cat3/strtoul.0 new file mode 100644 index 0000000000..c41ca8f1df --- /dev/null +++ b/usr/share/man/cat3/strtoul.0 @@ -0,0 +1,65 @@ +STRTOUL(3) BSD Programmer's Manual STRTOUL(3) + +NNAAMMEE + ssttrrttoouull,, ssttrrttoouuqq - convert a string to an unsigned long or uquad_t + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u_n_s_i_g_n_e_d _l_o_n_g + ssttrrttoouull(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + + + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u___q_u_a_d___t + ssttrrttoouuqq(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrttoouull() function converts the string in _n_p_t_r to an _u_n_s_i_g_n_e_d _l_o_n_g + value. The ssttrrttoouuqq() function converts the string in _n_p_t_r to a _u___q_u_a_d___t + value. The conversion is done according to the given _b_a_s_e, which must be + between 2 and 36 inclusive, or be the special value 0. + + The string may begin with an arbitrary amount of white space (as deter- + mined by isspace(3)) followed by a single optional `+' or `-' sign. If + _b_a_s_e is zero or 16, the string may then include a `0x' prefix, and the + number will be read in base 16; otherwise, a zero _b_a_s_e is taken as 10 + (decimal) unless the next character is `0', in which case it is taken as + 8 (octal). + + The remainder of the string is converted to an _u_n_s_i_g_n_e_d _l_o_n_g value in the + obvious manner, stopping at the end of the string or at the first charac- + ter that does not produce a valid digit in the given base. (In bases + above 10, the letter `A' in either upper or lower case represents 10, `B' + represents 11, and so forth, with `Z' representing 35.) + + If _e_n_d_p_t_r is non nil, ssttrrttoouull() stores the address of the first invalid + character in _*_e_n_d_p_t_r. If there were no digits at all, however, ssttrrttoouull() + stores the original value of _n_p_t_r in _*_e_n_d_p_t_r. (Thus, if _*_n_p_t_r is not `\0' + but _*_*_e_n_d_p_t_r is `\0' on return, the entire string was valid.) + +RREETTUURRNN VVAALLUUEESS + The ssttrrttoouull() function returns either the result of the conversion or, if + there was a leading minus sign, the negation of the result of the conver- + sion, unless the original (non-negated) value would overflow; in the lat- + ter case, ssttrrttoouull() returns ULONG_MAX and sets the global variable _e_r_r_n_o + to ERANGE. + +EERRRROORRSS + [ERANGE] The given string was out of range; the value converted has been + clamped. + +SSEEEE AALLSSOO + strtol(3) + +SSTTAANNDDAARRDDSS + The ssttrrttoouull() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + Ignores the current locale. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strtouq.0 b/usr/share/man/cat3/strtouq.0 new file mode 100644 index 0000000000..c41ca8f1df --- /dev/null +++ b/usr/share/man/cat3/strtouq.0 @@ -0,0 +1,65 @@ +STRTOUL(3) BSD Programmer's Manual STRTOUL(3) + +NNAAMMEE + ssttrrttoouull,, ssttrrttoouuqq - convert a string to an unsigned long or uquad_t + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u_n_s_i_g_n_e_d _l_o_n_g + ssttrrttoouull(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + + + ##iinncclluuddee <> + ##iinncclluuddee <> + ##iinncclluuddee <> + + _u___q_u_a_d___t + ssttrrttoouuqq(_c_o_n_s_t _c_h_a_r _*_n_p_t_r, _c_h_a_r _*_*_e_n_d_p_t_r, _i_n_t _b_a_s_e); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrttoouull() function converts the string in _n_p_t_r to an _u_n_s_i_g_n_e_d _l_o_n_g + value. The ssttrrttoouuqq() function converts the string in _n_p_t_r to a _u___q_u_a_d___t + value. The conversion is done according to the given _b_a_s_e, which must be + between 2 and 36 inclusive, or be the special value 0. + + The string may begin with an arbitrary amount of white space (as deter- + mined by isspace(3)) followed by a single optional `+' or `-' sign. If + _b_a_s_e is zero or 16, the string may then include a `0x' prefix, and the + number will be read in base 16; otherwise, a zero _b_a_s_e is taken as 10 + (decimal) unless the next character is `0', in which case it is taken as + 8 (octal). + + The remainder of the string is converted to an _u_n_s_i_g_n_e_d _l_o_n_g value in the + obvious manner, stopping at the end of the string or at the first charac- + ter that does not produce a valid digit in the given base. (In bases + above 10, the letter `A' in either upper or lower case represents 10, `B' + represents 11, and so forth, with `Z' representing 35.) + + If _e_n_d_p_t_r is non nil, ssttrrttoouull() stores the address of the first invalid + character in _*_e_n_d_p_t_r. If there were no digits at all, however, ssttrrttoouull() + stores the original value of _n_p_t_r in _*_e_n_d_p_t_r. (Thus, if _*_n_p_t_r is not `\0' + but _*_*_e_n_d_p_t_r is `\0' on return, the entire string was valid.) + +RREETTUURRNN VVAALLUUEESS + The ssttrrttoouull() function returns either the result of the conversion or, if + there was a leading minus sign, the negation of the result of the conver- + sion, unless the original (non-negated) value would overflow; in the lat- + ter case, ssttrrttoouull() returns ULONG_MAX and sets the global variable _e_r_r_n_o + to ERANGE. + +EERRRROORRSS + [ERANGE] The given string was out of range; the value converted has been + clamped. + +SSEEEE AALLSSOO + strtol(3) + +SSTTAANNDDAARRDDSS + The ssttrrttoouull() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +BBUUGGSS + Ignores the current locale. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/strxfrm.0 b/usr/share/man/cat3/strxfrm.0 new file mode 100644 index 0000000000..e42022d17d --- /dev/null +++ b/usr/share/man/cat3/strxfrm.0 @@ -0,0 +1,22 @@ +STRXFRM(3) BSD Programmer's Manual STRXFRM(3) + +NNAAMMEE + ssttrrxxffrrmm - transform a string under locale + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_i_z_e___t + ssttrrxxffrrmm(_c_h_a_r _*_d_s_t, _c_o_n_s_t _c_h_a_r _*_s_r_c, _s_i_z_e___t _n); + +DDEESSCCRRIIPPTTIIOONN + The ssttrrxxffrrmm() function does something horrible (see ANSI standard). In + this implementation it just copies. + +SSEEEE AALLSSOO + bcmp(3), memcmp(3), strcasecmp(3), strcmp(3), strcoll(3) + +SSTTAANNDDAARRDDSS + The ssttrrxxffrrmm() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/swab.0 b/usr/share/man/cat3/swab.0 new file mode 100644 index 0000000000..4863afa27f --- /dev/null +++ b/usr/share/man/cat3/swab.0 @@ -0,0 +1,24 @@ +SWAB(3) BSD Programmer's Manual SWAB(3) + +NNAAMMEE + sswwaabb - swap adjacent bytes + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + sswwaabb(_c_o_n_s_t _v_o_i_d _*_s_r_c, _v_o_i_d _*_d_s_t, _s_i_z_e___t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The function sswwaabb() copies _l_e_n bytes from the location referenced by _s_r_c + to the location referenced by _d_s_t, swapping adjacent bytes. + + The argument _l_e_n must be even number. + +SSEEEE AALLSSOO + bzero(3), memset(3) + +HHIISSTTOORRYY + A sswwaabb() function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/sys_siglist.0 b/usr/share/man/cat3/sys_siglist.0 new file mode 100644 index 0000000000..0d317e40b4 --- /dev/null +++ b/usr/share/man/cat3/sys_siglist.0 @@ -0,0 +1,37 @@ +PSIGNAL(3) BSD Programmer's Manual PSIGNAL(3) + +NNAAMMEE + ppssiiggnnaall, ssyyss__ssiigglliisstt ssyyss__ssiiggnnaammee - system signal messages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ppssiiggnnaall(_u_n_s_i_g_n_e_d _s_i_g, _c_o_n_s_t _c_h_a_r _*_s); + + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___s_i_g_l_i_s_t_[_]_; + _e_x_t_e_r_n _c_h_a_r _*_s_y_s___s_i_g_n_a_m_e_[_]_; + +DDEESSCCRRIIPPTTIIOONN + The ppssiiggnnaall() function locates the descriptive message string for the + given signal number _s_i_g and writes it to the standard error. + + If the argument _s is non-NULL it is written to the standard error file + descriptor prior to the message string, immediately followed by a colon + and a space. If the signal number is not recognized (sigaction(2)), the + string ``Unknown signal'' is produced. + + The message strings can be accessed directly through the external array + _s_y_s___s_i_g_l_i_s_t, indexed by recognized signal numbers. The external array + _s_y_s___s_i_g_n_a_m_e is used similarly and contains short, lower-case abbrevia- + tions for signals which are useful for recognizing signal names in user + input. The defined variable NSIG contains a count of the strings in + _s_y_s___s_i_g_l_i_s_t and _s_y_s___s_i_g_n_a_m_e. + +SSEEEE AALLSSOO + sigaction(2), perror(3) + +HHIISSTTOORRYY + The ppssiiggnnaall() function appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/sysconf.0 b/usr/share/man/cat3/sysconf.0 new file mode 100644 index 0000000000..dbe9308f4f --- /dev/null +++ b/usr/share/man/cat3/sysconf.0 @@ -0,0 +1,151 @@ +SYSCONF(3) BSD Programmer's Manual SYSCONF(3) + +NNAAMMEE + ssyyssccoonnff - get configurable system variables + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _l_o_n_g + ssyyssccoonnff(_i_n_t _n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + This interface is defined by IEEE Std1003.1-1988 (``POSIX''). A far more + complete interface is available using sysctl(3). + + The ssyyssccoonnff() function provides a method for applications to determine + the current value of a configurable system limit or option variable. The + _n_a_m_e argument specifies the system variable to be queried. Symbolic con- + stants for each name value are found in the include file . + + The available values are as follows: + + _SC_ARG_MAX + The maximum bytes of argument to exec(2). + + _SC_CHILD_MAX + The maximum number of simultaneous processes per user id. + + _SC_CLK_TCK + Number of micro-seconds per hz tick. + + _SC_NGROUPS_MAX + The maximum number of supplemental groups. + + _SC_OPEN_MAX + The maximum number of open files per user id. + + _SC_STREAM_MAX + The minimum maximum number of streams that a process may have + open at any one time. + + _SC_TZNAME_MAX + The minimum maximum number of types supported for the name of a + timezone. + + _SC_JOB_CONTROL + Return 1 if job control is available on this system, otherwise + -1. + + _SC_SAVED_IDS + Returns 1 if saved set-group and saved set-user ID is available, + otherwise -1. + + _SC_VERSION + The version of ISO/IEC 9945 (POSIX 1003.1) with which the system + attempts to comply. + + _SC_BC_BASE_MAX + The maximum ibase/obase values in the bc(1) utility. + + _SC_BC_DIM_MAX + The maximum array size in the bc(1) utility. + + _SC_BC_SCALE_MAX + + The maximum scale value in the bc(1) utility. + + _SC_BC_STRING_MAX + The maximum string length in the bc(1) utility. + + _SC_COLL_WEIGHTS_MAX + The maximum number of weights that can be assigned to any entry + of the LC_COLLATE order keyword in the locale definition file. + + _SC_EXPR_NEST_MAX + The maximum number of expressions that can be nested within + parenthesis by the expr(1) utility. + + _SC_LINE_MAX + The maximum length in bytes of a text-processing utility's input + line. + + _SC_RE_DUP_MAX + The maximum number of repeated occurrences of a regular expres- + sion permitted when using interval notation. + + _SC_2_VERSION + The version of POSIX 1003.2 with which the system attempts to + comply. + + _SC_2_C_BIND + Return 1 if the system's C-language development facilities sup- + port the C-Language Bindings Option, otherwise -1. + + _SC_2_C_DEV + Return 1 if the system supports the C-Language Development Utili- + ties Option, otherwise -1. + + _SC_2_CHAR_TERM + Return 1 if the system supports at least one terminal type capa- + ble of all operations described in POSIX 1003.2, otherwise -1. + + _SC_2_FORT_DEV + Return 1 if the system supports the FORTRAN Development Utilities + Option, otherwise -1. + + _SC_2_FORT_RUN + Return 1 if the system supports the FORTRAN Runtime Utilities Op- + tion, otherwise -1. + + _SC_2_LOCALEDEF + Return 1 if the system supports the creation of locales, other- + wise -1. + + _SC_2_SW_DEV + Return 1 if the system supports the Software Development Utili- + ties Option, otherwise -1. + + _SC_2_UPE + Return 1 if the system supports the User Portability Utilities + Option, otherwise -1. + +RREETTUURRNN VVAALLUUEESS + If the call to ssyyssccoonnff is not successful, -1 is returned and _e_r_r_n_o is set + appropriately. Otherwise, if the variable is associated with funtionali- + ty that is not supported, -1 is returned and _e_r_r_n_o is not modified. Oth- + erwise, the current variable value is returned. + +EERRRROORRSS + The ssyyssccoonnff() function may fail and set _e_r_r_n_o for any of the errors spec- + ified for the library functions sysctl(3). In addition, the following + + errors may be reported: + + [EINVAL] The value of the _n_a_m_e argument is invalid. + +SSEEEE AALLSSOO + sysctl(3) + +BBUUGGSS + The value for _SC_STREAM_MAX is a minimum maximum, and required to be the + same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously small + and misleading number. + +SSTTAANNDDAARRDDSS + The ssyyssccoonnff() function conforms to IEEE Std1003.1-1988 (``POSIX''). + +HHIISSTTOORRYY + The ssyyssccoonnff function first appeared in 4.4BSD. + +4th Berkeley Distribution July 12, 1993 3 diff --git a/usr/share/man/cat3/sysctl.0 b/usr/share/man/cat3/sysctl.0 new file mode 100644 index 0000000000..ae4a3c4649 --- /dev/null +++ b/usr/share/man/cat3/sysctl.0 @@ -0,0 +1,568 @@ +SYSCTL(3) BSD Programmer's Manual SYSCTL(3) + +NNAAMMEE + ssyyssccttll - get or set system information + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssyyssccttll(_i_n_t _*_n_a_m_e, _u___i_n_t _n_a_m_e_l_e_n, _v_o_i_d _*_o_l_d_p, _s_i_z_e___t _*_o_l_d_l_e_n_p, _v_o_i_d _*_n_e_w_p, + _s_i_z_e___t _n_e_w_l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ssyyssccttll function retrieves system information and allows processes + with appropriate privileges to set system information. The information + available from ssyyssccttll consists of integers, strings, and tables. Infor- + mation may be retrieved and set from the command interface using the + sysctl(1) utility. + + Unless explicitly noted below, ssyyssccttll returns a consistent snapshot of + the data requested. Consistency is obtained by locking the destination + buffer into memory so that the data may be copied out without blocking. + Calls to ssyyssccttll are serialized to avoid deadlock. + + The state is described using a ``Management Information Base'' (MIB) + style name, listed in _n_a_m_e, which is a _n_a_m_e_l_e_n length array of integers. + + The information is copied into the buffer specified by _o_l_d_p. The size of + the buffer is given by the location specified by _o_l_d_l_e_n_p before the call, + and that location gives the amount of data copied after a successful + call. If the amount of data available is greater than the size of the + buffer supplied, the call supplies as much data as fits in the buffer + provided and returns with the error code ENOMEM. If the old value is not + desired, _o_l_d_p and _o_l_d_l_e_n_p should be set to NULL. + + The size of the available data can be determined by calling ssyyssccttll with a + NULL parameter for _o_l_d_p. The size of the available data will be returned + in the location pointed to by _o_l_d_l_e_n_p. For some operations, the amount of + space may change often. For these operations, the system attempts to + round up so that the returned size is large enough for a call to return + the data shortly thereafter. + + To set a new value, _n_e_w_p is set to point to a buffer of length _n_e_w_l_e_n + from which the requested value is to be taken. If a new value is not to + be set, _n_e_w_p should be set to NULL and _n_e_w_l_e_n set to 0. + + The top level names are defined with a CTL_ prefix in _<_s_y_s_/_s_y_s_c_t_l_._h_>, and + are as follows. The next and subsequent levels down are found in the in- + clude files listed here, and described in separate sections below. + + _N_a_m_e _N_e_x_t _l_e_v_e_l _n_a_m_e_s _D_e_s_c_r_i_p_t_i_o_n + CTL_DEBUG sys/sysctl.h Debugging + CTL_FS sys/sysctl.h File system + CTL_HW sys/sysctl.h Generic CPU, I/O + CTL_KERN sys/sysctl.h High kernel limits + CTL_MACHDEP sys/sysctl.h Machine dependent + CTL_NET sys/socket.h Networking + CTL_USER sys/sysctl.h User-level + CTL_VM vm/vm_param.h Virtual memory + + For example, the following retrieves the maximum number of processes al- + lowed in the system: + int mib[2], maxproc; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_MAXPROC; + len = sizeof(maxproc); + sysctl(mib, 2, &maxproc, &len, NULL, 0); + + To retrieve the standard search path for the system utilities: + int mib[2]; + size_t len; + char *p; + + mib[0] = CTL_USER; + mib[1] = USER_CS_PATH; + sysctl(mib, 2, NULL, &len, NULL, 0); + p = malloc(len); + sysctl(mib, 2, p, &len, NULL, 0); + +CCTTLL__DDEEBBUUGG + The debugging variables vary from system to system. A debugging variable + may be added or deleted without need to recompile ssyyssccttll to know about + it. Each time it runs, ssyyssccttll gets the list of debugging variables from + the kernel and displays their current values. The system defines twenty + (_s_t_r_u_c_t _c_t_l_d_e_b_u_g) variables named ddeebbuugg00 through ddeebbuugg1199. They are de- + clared as separate variables so that they can be individually initialized + at the location of their associated variable. The loader prevents multi- + ple use of the same variable by issuing errors if a variable is initial- + ized in more than one place. For example, to export the variable + ddoossppeecciiaallcchheecckk as a debugging variable, the following declaration would + be used: + int dospecialcheck = 1; + struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck }; + +CCTTLL__FFSS + There are currently no second level names for the file system. + +CCTTLL__HHWW + The string and integer information available for the CTL_HW level is de- + tailed below. The changeable column shows whether a process with appro- + priate privilege may change the value. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + HW_MACHINE string no + HW_MODEL string no + HW_NCPU integer no + HW_BYTEORDER integer no + HW_PHYSMEM integer no + HW_USERMEM integer no + HW_PAGESIZE integer no + + HW_MACHINE + The machine class. + + HW_MODEL + The machine model + + HW_NCPU + The number of cpus. + + HW_BYTEORDER + The byteorder (4,321, or 1,234). + + HW_PHYSMEM + The bytes of physical memory. + + HW_USERMEM + + + The bytes of non-kernel memory. + + HW_PAGESIZE + The software page size. + +CCTTLL__KKEERRNN + The string and integer information available for the CTL_KERN level is + detailed below. The changeable column shows whether a process with ap- + propriate privilege may change the value. The types of data currently + available are process information, system vnodes, the open file entries, + routing table entries, virtual memory statistics, load average history, + and clock rate information. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + KERN_ARGMAX integer no + KERN_BOOTTIME struct timeval no + KERN_CHOWN_RESTRICTED integer no + KERN_CLOCKRATE struct clockinfo no + KERN_FILE struct file no + KERN_HOSTID integer yes + KERN_HOSTNAME string yes + KERN_JOB_CONTROL integer no + KERN_LINK_MAX integer no + KERN_MAXFILES integer yes + KERN_MAXPROC integer yes + KERN_MAXVNODES integer yes + KERN_MAX_CANON integer no + KERN_MAX_INPUT integer no + KERN_NAME_MAX integer no + KERN_NGROUPS integer no + KERN_NO_TRUNC integer no + KERN_OSRELEASE string no + KERN_OSREV integer no + KERN_OSTYPE string no + KERN_PATH_MAX integer no + KERN_PIPE_BUF integer no + KERN_POSIX1 integer no + KERN_PROC struct proc no + KERN_PROF node not applicable + KERN_SAVED_IDS integer no + KERN_SECURELVL integer raise only + KERN_VDISABLE integer no + KERN_VERSION string no + KERN_VNODE struct vnode no + + KERN_ARGMAX + The maximum bytes of argument to exec(2). + + KERN_BOOTTIME + A _s_t_r_u_c_t _t_i_m_e_v_a_l structure is returned. This structure contains + the time that the system was booted. + + KERN_CHOWN_RESTRICTED + Return 1 if appropriate privileges are required for the chown(2) + system call, otherwise 0. + + KERN_CLOCKRATE + A _s_t_r_u_c_t _c_l_o_c_k_i_n_f_o structure is returned. This structure con- + tains the clock, statistics clock and profiling clock frequen- + cies, and the number of micro-seconds per hz tick. + + KERN_FILE + Return the entire file table. The returned data consists of a + single _s_t_r_u_c_t _f_i_l_e_h_e_a_d followed by an array of _s_t_r_u_c_t _f_i_l_e, whose + size depends on the current number of such objects in the system. + + + KERN_HOSTID + Get or set the host id. + + KERN_HOSTNAME + Get or set the hostname. + + KERN_JOB_CONTROL + Return 1 if job control is available on this system, otherwise 0. + + KERN_LINK_MAX + The maximum file link count. + + KERN_MAXFILES + The maximum number of open files that may be open in the system. + + KERN_MAXPROC + The maximum number of simultaneous processes the system will al- + low. + + KERN_MAXVNODES + The maximum number of vnodes available on the system. + + KERN_MAX_CANON + The maximum number of bytes in terminal canonical input line. + + KERN_MAX_INPUT + The minimum maximum number of bytes for which space is available + in a terminal input queue. + + KERN_NAME_MAX + The maximum number of bytes in a file name. + + KERN_NGROUPS + The maximum number of supplemental groups. + + KERN_NO_TRUNC + Return 1 if file names longer than KERN_NAME_MAX are truncated. + + KERN_OSRELEASE + The system release string. + + KERN_OSREV + The system revision string. + + KERN_OSTYPE + The system type string. + + KERN_PATH_MAX + The maximum number of bytes in a pathname. + + KERN_PIPE_BUF + The maximum number of bytes which will be written atomically to a + pipe. + + KERN_POSIX1 + The version of ISO/IEC 9945 (POSIX 1003.1) with which the system + attempts to comply. + + KERN_PROC + Return the entire process table, or a subset of it. An array of + _s_t_r_u_c_t _k_i_n_f_o___p_r_o_c structures is returned, whose size depends on + the current number of such objects in the system. The third and + fourth level names are as follows: + + + + _T_h_i_r_d _l_e_v_e_l _n_a_m_e _F_o_u_r_t_h _l_e_v_e_l _i_s_: + KERN_PROC_ALL None + KERN_PROC_PID A process ID + KERN_PROC_PGRP A process group + KERN_PROC_TTY A tty device + KERN_PROC_UID A user ID + KERN_PROC_RUID A real user ID + + KERN_PROF + Return profiling information about the kernel. If the kernel is + not compiled for profiling, attempts to retrieve any of the + KERN_PROF values will fail with EOPNOTSUPP. The third level + names for the string and integer profiling information is de- + tailed below. The changeable column shows whether a process with + appropriate privilege may change the value. + + _T_h_i_r_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + GPROF_STATE integer yes + GPROF_COUNT u_short[] yes + GPROF_FROMS u_short[] yes + GPROF_TOS struct tostruct yes + GPROF_GMONPARAM struct gmonparam no + + The variables are as follows: + + GPROF_STATE + Returns GMON_PROF_ON or GMON_PROF_OFF to show that pro- + filing is running or stopped. + + GPROF_COUNT + Array of statistical program counter counts. + + GPROF_FROMS + Array indexed by program counter of call-from points. + + GPROF_TOS + Array of _s_t_r_u_c_t _t_o_s_t_r_u_c_t describing destination of calls + and their counts. + + GPROF_GMONPARAM + Structure giving the sizes of the above arrays. + + KERN_SAVED_IDS + Returns 1 if saved set-group and saved set-user ID is available. + + KERN_SECURELVL + The system security level. This level may be raised by processes + with appropriate privilege. It may only be lowered by process 1. + + KERN_VDISABLE + Returns the terminal character disabling value. + + KERN_VERSION + The system version string. + + KERN_VNODE + Return the entire vnode table. Note, the vnode table is not nec- + essarily a consistent snapshot of the system. The returned data + consists of an array whose size depends on the current number of + such objects in the system. Each element of the array contains + the kernel address of a vnode _s_t_r_u_c_t _v_n_o_d_e _* followed by the vn- + ode itself _s_t_r_u_c_t _v_n_o_d_e. + +CCTTLL__MMAACCHHDDEEPP + The set of variables defined is architecture dependent. Most architec- + tures define at least the following variables. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + CPU_CONSDEV dev_t no + +CCTTLL__NNEETT + The string and integer information available for the CTL_NET level is de- + tailed below. The changeable column shows whether a process with appro- + priate privilege may change the value. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + PF_ROUTE routing messages no + PF_INET internet values yes + + PF_ROUTE + Return the entire routing table or a subset of it. The data is + returned as a sequence of routing messages (see route(4) for the + header file, format and meaning). The length of each message is + contained in the message header. + + The third level name is a protocol number, which is currently al- + ways 0. The fourth level name is an address family, which may be + set to 0 to select all address families. The fifth and sixth + level names are as follows: + + _F_i_f_t_h _l_e_v_e_l _n_a_m_e _S_i_x_t_h _l_e_v_e_l _i_s_: + NET_RT_FLAGS rtflags + NET_RT_DUMP None + NET_RT_IFLIST None + + PF_INET + Get or set various global information about the internet proto- + cols. The third level name is the protocol. The fourth level + name is the variable name. The currently defined protocols and + names are: + + _P_r_o_t_o_c_o_l _n_a_m_e _V_a_r_i_a_b_l_e + _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + ip forwarding integer yes + ip redirect integer yes + ip ttl integer yes + icmp maskrepl integer yes + udp checksum integer yes + + The variables are as follows: + + ip.forwarding + Returns 1 when IP forwarding is enabled for the host, + meaning that the host is acting as a router. + + ip.redirect + Returns 1 when ICMP redirects may be sent by the host. + This option is ignored unless the host is routing IP + packets, and should normally be enabled on all systems. + + ip.ttl The maximum time-to-live (hop count) value for an IP + packet sourced by the system. This value applies to nor- + mal transport protocols, not to ICMP. + + icmp.maskrepl + Returns 1 if ICMP network mask requests are to be an- + swered. + + udp.checksum + Returns 1 when UDP checksums are being computed and + checked. Disabling UDP checksums is strongly discour- + aged. + +CCTTLL__UUSSEERR + The string and integer information available for the CTL_USER level is + detailed below. The changeable column shows whether a process with ap- + propriate privilege may change the value. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + USER_BC_BASE_MAX integer no + USER_BC_DIM_MAX integer no + USER_BC_SCALE_MAX integer no + USER_BC_STRING_MAX integer no + USER_COLL_WEIGHTS_MAX integer no + USER_CS_PATH string no + USER_EXPR_NEST_MAX integer no + USER_LINE_MAX integer no + USER_POSIX2_CHAR_TERM integer no + USER_POSIX2_C_BIND integer no + USER_POSIX2_C_DEV integer no + USER_POSIX2_FORT_DEV integer no + USER_POSIX2_FORT_RUN integer no + USER_POSIX2_LOCALEDEF integer no + USER_POSIX2_SW_DEV integer no + USER_POSIX2_UPE integer no + USER_POSIX2_VERSION integer no + USER_RE_DUP_MAX integer no + USER_STREAM_MAX integer no + USER_TZNAME_MAX integer no + + USER_BC_BASE_MAX + The maximum ibase/obase values in the bc(1) utility. + + USER_BC_DIM_MAX + The maximum array size in the bc(1) utility. + + USER_BC_SCALE_MAX + The maximum scale value in the bc(1) utility. + + USER_BC_STRING_MAX + The maximum string length in the bc(1) utility. + + USER_COLL_WEIGHTS_MAX + The maximum number of weights that can be assigned to any entry + of the LC_COLLATE order keyword in the locale definition file. + + USER_CS_PATH + Return a value for the PATH environment variable that finds all + the standard utilities. + + USER_EXPR_NEST_MAX + The maximum number of expressions that can be nested within + parenthesis by the expr(1) utility. + + USER_LINE_MAX + The maximum length in bytes of a text-processing utility's input + line. + + USER_POSIX2_CHAR_TERM + Return 1 if the system supports at least one terminal type capa- + ble of all operations described in POSIX 1003.2, otherwise 0. + + USER_POSIX2_C_BIND + Return 1 if the system's C-language development facilities sup- + port the C-Language Bindings Option, otherwise 0. + + USER_POSIX2_C_DEV + Return 1 if the system supports the C-Language Development Utili- + ties Option, otherwise 0. + + USER_POSIX2_FORT_DEV + Return 1 if the system supports the FORTRAN Development Utilities + Option, otherwise 0. + + USER_POSIX2_FORT_RUN + Return 1 if the system supports the FORTRAN Runtime Utilities Op- + tion, otherwise 0. + + USER_POSIX2_LOCALEDEF + Return 1 if the system supports the creation of locales, other- + wise 0. + + USER_POSIX2_SW_DEV + Return 1 if the system supports the Software Development Utili- + ties Option, otherwise 0. + + USER_POSIX2_UPE + Return 1 if the system supports the User Portability Utilities + Option, otherwise 0. + + USER_POSIX2_VERSION + The version of POSIX 1003.2 with which the system attempts to + comply. + + USER_RE_DUP_MAX + The maximum number of repeated occurrences of a regular expres- + sion permitted when using interval notation. + + USER_STREAM_MAX + The minimum maximum number of streams that a process may have + open at any one time. + + USER_TZNAME_MAX + The minimum maximum number of types supported for the name of a + timezone. + +CCTTLL__VVMM + The string and integer information available for the CTL_VM level is de- + tailed below. The changeable column shows whether a process with appro- + priate privilege may change the value. + + _S_e_c_o_n_d _l_e_v_e_l _n_a_m_e _T_y_p_e _C_h_a_n_g_e_a_b_l_e + VM_LOADAVG struct loadavg no + VM_METER struct vmtotal no + + VM_LOADAVG + Return the load average history. The returned data consists of a + _s_t_r_u_c_t _l_o_a_d_a_v_g. + + VM_METER + Return the system wide virtual memory statistics. The returned + data consists of a _s_t_r_u_c_t _v_m_t_o_t_a_l. + +RREETTUURRNN VVAALLUUEESS + If the call to ssyyssccttll is successful, 0 is returned. Otherwise -1 is re- + turned and _e_r_r_n_o is set appropriately. + +EERRRROORRSS + The following errors may be reported: + + [EFAULT] The buffer _n_a_m_e, _o_l_d_p, _n_e_w_p, or length pointer _o_l_d_l_e_n_p con- + + + tains an invalid address. + + [EINVAL] The _n_a_m_e array is less than two or greater than + CTL_MAXNAME. + + [EINVAL] A non-null _n_e_w_p is given and its specified length in _n_e_w_l_e_n + is too large or too small. + + [ENOMEM] The length pointed to by _o_l_d_l_e_n_p is too short to hold the + requested value. + + [ENOTDIR] The _n_a_m_e array specifies an intermediate rather than termi- + nal name. + + [EOPNOTSUPP] The _n_a_m_e array specifies a value that is unknown. + + [EPERM] An attempt is made to set a read-only value. + + [EPERM] A process without appropriate privilege attempts to set a + value. + +FFIILLEESS + definitions for top level identifiers, second level + kernel and hardware identifiers, and user level + identifiers + definitions for second level network identifiers + definitions for third level profiling identifiers + definitions for second level virtual memory identi- + fiers + definitions for third level Internet identifiers + and fourth level IP identifiers + definitions for fourth level ICMP identifiers + definitions for fourth level UDP identifiers + +SSEEEE AALLSSOO + sysctl(8) + +HHIISSTTOORRYY + The ssyyssccttll function first appeared in 4.4BSD. + +4.4BSD June 4, 1993 9 diff --git a/usr/share/man/cat3/syslog.0 b/usr/share/man/cat3/syslog.0 new file mode 100644 index 0000000000..cbcb3a15d5 --- /dev/null +++ b/usr/share/man/cat3/syslog.0 @@ -0,0 +1,150 @@ +SYSLOG(3) BSD Programmer's Manual SYSLOG(3) + +NNAAMMEE + ssyysslloogg, vvssyysslloogg, ooppeennlloogg, cclloosseelloogg, sseettllooggmmaasskk - control system log + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + ssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _._._.); + + _v_o_i_d + vvssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + ooppeennlloogg(_c_o_n_s_t _c_h_a_r _*_i_d_e_n_t, _i_n_t _l_o_g_o_p_t, _i_n_t _f_a_c_i_l_i_t_y); + + _v_o_i_d + cclloosseelloogg(_v_o_i_d); + + _i_n_t + sseettllooggmmaasskk(_i_n_t _m_a_s_k_p_r_i); + +DDEESSCCRRIIPPTTIIOONN + The ssyysslloogg() function writes _m_e_s_s_a_g_e to the system message logger. The + message is then written to the system console, log files, logged-in + users, or forwarded to other machines as appropriate. (See syslogd(8).) + + The message is identical to a printf(3) format string, except that `%m' + is replaced by the current error message. (As denoted by the global vari- + able _e_r_r_n_o; see strerror(3).) A trailing newline is added if none is + present. + + The vvssyysslloogg() function is an alternate form in which the arguments have + already been captured using the variable-length argument facilities of + varargs(3). + + The message is tagged with _p_r_i_o_r_i_t_y. Priorities are encoded as a _f_a_c_i_l_i_t_y + and a _l_e_v_e_l. The facility describes the part of the system generating the + message. The level is selected from the following _o_r_d_e_r_e_d (high to low) + list: + + LOG_EMERG A panic condition. This is normally broadcast to all + users. + + LOG_ALERT A condition that should be corrected immediately, such as a + corrupted system database. + + LOG_CRIT Critical conditions, e.g., hard device errors. + + LOG_ERR Errors. + + LOG_WARNING Warning messages. + + LOG_NOTICE Conditions that are not error conditions, but should possi- + bly be handled specially. + + LOG_INFO Informational messages. + + LOG_DEBUG Messages that contain information normally of use only when + debugging a program. + + The ooppeennlloogg() function provides for more specialized processing of the + messages sent by ssyysslloogg() and vvssyysslloogg(). The parameter _i_d_e_n_t is a string + that will be prepended to every message. The _l_o_g_o_p_t argument is a bit + field specifying logging options, which is formed by OR'ing one or more + of the following values: + + LOG_CONS If ssyysslloogg() cannot pass the message to syslogd it will at- + tempt to write the message to the console + (``_/_d_e_v_/_c_o_n_s_o_l_e_.'') + + LOG_NDELAY Open the connection to syslogd immediately. Normally the + open is delayed until the first message is logged. Useful + for programs that need to manage the order in which file + descriptors are allocated. + + LOG_PERROR Write the message to standard error output as well to the + system log. + + LOG_PID Log the process id with each message: useful for identify- + ing instantiations of daemons. + + The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all + messages that do not have an explicit facility encoded: + + LOG_AUTH The authorization system: login(1), su(1), getty(8), + etc. + + LOG_AUTHPRIV The same as LOG_AUTH, but logged to a file readable only by + selected individuals. + + LOG_CRON The clock daemon. + + LOG_DAEMON System daemons, such as routed(8), that are not provided + for explicitly by other facilities. + + LOG_KERN Messages generated by the kernel. These cannot be generat- + ed by any user processes. + + LOG_LPR The line printer spooling system: lpr(1), lpc(8), lpd(8), + etc. + + LOG_MAIL The mail system. + + LOG_NEWS The network news system. + + LOG_SYSLOG Messages generated internally by syslogd(8). + + LOG_USER Messages generated by random user processes. This is the + default facility identifier if none is specified. + + LOG_UUCP The uucp system. + + LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through + LOG_LOCAL7. + + The cclloosseelloogg() function can be used to close the log file. + + The sseettllooggmmaasskk() function sets the log priority mask to _m_a_s_k_p_r_i and re- + turns the previous mask. Calls to ssyysslloogg() with a priority not set in + _m_a_s_k_p_r_i are rejected. The mask for an individual priority _p_r_i is calcu- + lated by the macro LLOOGG__MMAASSKK(_p_r_i); the mask for all priorities up to and + including _t_o_p_p_r_i is given by the macro LLOOGG__UUPPTTOO(_t_o_p_p_r_i);. The default al- + lows all priorities to be logged. + +RREETTUURRNN VVAALLUUEESS + The routines cclloosseelloogg(), ooppeennlloogg(), ssyysslloogg() and vvssyysslloogg() return no val- + ue. + + + The routine sseettllooggmmaasskk() always returns the previous log mask level. + +EEXXAAMMPPLLEESS + syslog(LOG_ALERT, "who: internal error 23"); + + openlog("ftpd", LOG_PID, LOG_DAEMON); + setlogmask(LOG_UPTO(LOG_ERR)); + syslog(LOG_INFO, "Connection from host %d", CallingHost); + + syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); + +SSEEEE AALLSSOO + logger(1), syslogd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/system.0 b/usr/share/man/cat3/system.0 new file mode 100644 index 0000000000..647027fd0d --- /dev/null +++ b/usr/share/man/cat3/system.0 @@ -0,0 +1,30 @@ +SYSTEM(3) BSD Programmer's Manual SYSTEM(3) + +NNAAMMEE + ssyysstteemm - pass a command to the shell + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssyysstteemm(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + +DDEESSCCRRIIPPTTIIOONN + The ssyysstteemm() function hands the argument _s_t_r_i_n_g to the command inter- + preter sh(1). The calling process waits for the shell to finish execut- + ing the command, ignoring SIGINT and SIGQUIT, and blocking SIGCHLD. + + If _s_t_r_i_n_g is a NULL pointer, ssyysstteemm() will return non-zero if the command + interpreter sh(1) is available, and zero if it is not. + + The ssyysstteemm() function returns the exit status of the shell, or -1 if the + wait(3) for the shell failed. A return value of 127 means the execution + of the shell failed. + +SSEEEE AALLSSOO + sh(1), execve(2), wait(2), popen(3) + +SSTTAANNDDAARRDDSS + The ssyysstteemm() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tcdrain.0 b/usr/share/man/cat3/tcdrain.0 new file mode 100644 index 0000000000..112c9253e4 --- /dev/null +++ b/usr/share/man/cat3/tcdrain.0 @@ -0,0 +1,81 @@ +TCSENDBREAK(3) BSD Programmer's Manual TCSENDBREAK(3) + +NNAAMMEE + ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh, ttccffllooww - line control functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttccddrraaiinn(_i_n_t _f_d); + + _i_n_t + ttccffllooww(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccfflluusshh(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccsseennddbbrreeaakk(_i_n_t _f_d, _i_n_t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ttccddrraaiinn function waits until all output written to the terminal ref- + erenced by _f_d has been transmitted to the terminal. + + The ttccffllooww function suspends transmission of data to or the reception of + data from the terminal referenced by _f_d depending on the value of _a_c_t_i_o_n. + The value of _a_c_t_i_o_n must be one of the following: + + _T_C_O_O_F_F Suspend output. + + _T_C_O_O_N Restart suspended output. + + _T_C_I_O_F_F Transmit a STOP character, which is intended to cause the termi- + nal to stop transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + _T_C_I_O_N Transmit a START character, which is intended to cause the termi- + nal to start transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + The ttccfflluusshh function discards any data written to the terminal referenced + by _f_d which has not been transmitted to the terminal, or any data re- + ceived from the terminal but not yet read, depending on the value of + _a_c_t_i_o_n. The value of _a_c_t_i_o_n must be one of the following: + + _T_C_I_F_L_U_S_H Flush data received but not read. + + _T_C_O_F_L_U_S_H Flush data written but not transmitted. + + _T_C_I_O_F_L_U_S_H Flush both data received but not read and data written but not + transmitted. + + The ttccsseennddbbrreeaakk function transmits a continuous stream of zero-valued + bits for four-tenths of a second to the terminal referenced by _f_d. The + _l_e_n parameter is ignored in this implementation. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, all of these functions return a value of ze- + ro. + +EERRRROORRSS + If any error occurs, a value of -1 is returned and the global variable + _e_r_r_n_o is set to indicate the error, as follows: + + + [EBADF] The _f_d argument is not a valid file descriptor. + + [EINVAL] The _a_c_t_i_o_n argument is not a proper value. + + [ENOTTY] The file associated with _f_d is not a terminal. + + [EINTR] A signal interrupted the ttccddrraaiinn function. + +SSEEEE AALLSSOO + tcsetattr(3), termios(4) + +SSTTAANNDDAARRDDSS + The ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh and ttccffllooww functions are expected to be + compliant with the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/tcflow.0 b/usr/share/man/cat3/tcflow.0 new file mode 100644 index 0000000000..112c9253e4 --- /dev/null +++ b/usr/share/man/cat3/tcflow.0 @@ -0,0 +1,81 @@ +TCSENDBREAK(3) BSD Programmer's Manual TCSENDBREAK(3) + +NNAAMMEE + ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh, ttccffllooww - line control functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttccddrraaiinn(_i_n_t _f_d); + + _i_n_t + ttccffllooww(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccfflluusshh(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccsseennddbbrreeaakk(_i_n_t _f_d, _i_n_t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ttccddrraaiinn function waits until all output written to the terminal ref- + erenced by _f_d has been transmitted to the terminal. + + The ttccffllooww function suspends transmission of data to or the reception of + data from the terminal referenced by _f_d depending on the value of _a_c_t_i_o_n. + The value of _a_c_t_i_o_n must be one of the following: + + _T_C_O_O_F_F Suspend output. + + _T_C_O_O_N Restart suspended output. + + _T_C_I_O_F_F Transmit a STOP character, which is intended to cause the termi- + nal to stop transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + _T_C_I_O_N Transmit a START character, which is intended to cause the termi- + nal to start transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + The ttccfflluusshh function discards any data written to the terminal referenced + by _f_d which has not been transmitted to the terminal, or any data re- + ceived from the terminal but not yet read, depending on the value of + _a_c_t_i_o_n. The value of _a_c_t_i_o_n must be one of the following: + + _T_C_I_F_L_U_S_H Flush data received but not read. + + _T_C_O_F_L_U_S_H Flush data written but not transmitted. + + _T_C_I_O_F_L_U_S_H Flush both data received but not read and data written but not + transmitted. + + The ttccsseennddbbrreeaakk function transmits a continuous stream of zero-valued + bits for four-tenths of a second to the terminal referenced by _f_d. The + _l_e_n parameter is ignored in this implementation. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, all of these functions return a value of ze- + ro. + +EERRRROORRSS + If any error occurs, a value of -1 is returned and the global variable + _e_r_r_n_o is set to indicate the error, as follows: + + + [EBADF] The _f_d argument is not a valid file descriptor. + + [EINVAL] The _a_c_t_i_o_n argument is not a proper value. + + [ENOTTY] The file associated with _f_d is not a terminal. + + [EINTR] A signal interrupted the ttccddrraaiinn function. + +SSEEEE AALLSSOO + tcsetattr(3), termios(4) + +SSTTAANNDDAARRDDSS + The ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh and ttccffllooww functions are expected to be + compliant with the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/tcflush.0 b/usr/share/man/cat3/tcflush.0 new file mode 100644 index 0000000000..112c9253e4 --- /dev/null +++ b/usr/share/man/cat3/tcflush.0 @@ -0,0 +1,81 @@ +TCSENDBREAK(3) BSD Programmer's Manual TCSENDBREAK(3) + +NNAAMMEE + ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh, ttccffllooww - line control functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttccddrraaiinn(_i_n_t _f_d); + + _i_n_t + ttccffllooww(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccfflluusshh(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccsseennddbbrreeaakk(_i_n_t _f_d, _i_n_t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ttccddrraaiinn function waits until all output written to the terminal ref- + erenced by _f_d has been transmitted to the terminal. + + The ttccffllooww function suspends transmission of data to or the reception of + data from the terminal referenced by _f_d depending on the value of _a_c_t_i_o_n. + The value of _a_c_t_i_o_n must be one of the following: + + _T_C_O_O_F_F Suspend output. + + _T_C_O_O_N Restart suspended output. + + _T_C_I_O_F_F Transmit a STOP character, which is intended to cause the termi- + nal to stop transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + _T_C_I_O_N Transmit a START character, which is intended to cause the termi- + nal to start transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + The ttccfflluusshh function discards any data written to the terminal referenced + by _f_d which has not been transmitted to the terminal, or any data re- + ceived from the terminal but not yet read, depending on the value of + _a_c_t_i_o_n. The value of _a_c_t_i_o_n must be one of the following: + + _T_C_I_F_L_U_S_H Flush data received but not read. + + _T_C_O_F_L_U_S_H Flush data written but not transmitted. + + _T_C_I_O_F_L_U_S_H Flush both data received but not read and data written but not + transmitted. + + The ttccsseennddbbrreeaakk function transmits a continuous stream of zero-valued + bits for four-tenths of a second to the terminal referenced by _f_d. The + _l_e_n parameter is ignored in this implementation. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, all of these functions return a value of ze- + ro. + +EERRRROORRSS + If any error occurs, a value of -1 is returned and the global variable + _e_r_r_n_o is set to indicate the error, as follows: + + + [EBADF] The _f_d argument is not a valid file descriptor. + + [EINVAL] The _a_c_t_i_o_n argument is not a proper value. + + [ENOTTY] The file associated with _f_d is not a terminal. + + [EINTR] A signal interrupted the ttccddrraaiinn function. + +SSEEEE AALLSSOO + tcsetattr(3), termios(4) + +SSTTAANNDDAARRDDSS + The ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh and ttccffllooww functions are expected to be + compliant with the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/tcgetattr.0 b/usr/share/man/cat3/tcgetattr.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/tcgetattr.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/tcgetpgrp.0 b/usr/share/man/cat3/tcgetpgrp.0 new file mode 100644 index 0000000000..4c7287e1df --- /dev/null +++ b/usr/share/man/cat3/tcgetpgrp.0 @@ -0,0 +1,35 @@ +TCGETPGRP(3) BSD Programmer's Manual TCGETPGRP(3) + +NNAAMMEE + ttccggeettppggrrpp - get foreground process group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _p_i_d___t + ttccggeettppggrrpp(_i_n_t _f_d); + +DDEESSCCRRIIPPTTIIOONN + The ttccggeettppggrrpp function returns the value of the process group ID of the + foreground process group associated with the terminal device. If there + is no foreground process group, ttccggeettppggrrpp returns an invalid process ID. + +EERRRROORRSS + If an error occurs, ttccggeettppggrrpp returns -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument is not a valid file descriptor. + + [ENOTTY] The calling process does not have a controlling terminal or + the underlying terminal device represented by _f_d is not the + controlling terminal. + +SSEEEE AALLSSOO + setpgid(3), setsid(2), tcsetpgrp(3) + +SSTTAANNDDAARRDDSS + The ttccggeettppggrrpp function is expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tcsendbreak.0 b/usr/share/man/cat3/tcsendbreak.0 new file mode 100644 index 0000000000..112c9253e4 --- /dev/null +++ b/usr/share/man/cat3/tcsendbreak.0 @@ -0,0 +1,81 @@ +TCSENDBREAK(3) BSD Programmer's Manual TCSENDBREAK(3) + +NNAAMMEE + ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh, ttccffllooww - line control functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttccddrraaiinn(_i_n_t _f_d); + + _i_n_t + ttccffllooww(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccfflluusshh(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n); + + _i_n_t + ttccsseennddbbrreeaakk(_i_n_t _f_d, _i_n_t _l_e_n); + +DDEESSCCRRIIPPTTIIOONN + The ttccddrraaiinn function waits until all output written to the terminal ref- + erenced by _f_d has been transmitted to the terminal. + + The ttccffllooww function suspends transmission of data to or the reception of + data from the terminal referenced by _f_d depending on the value of _a_c_t_i_o_n. + The value of _a_c_t_i_o_n must be one of the following: + + _T_C_O_O_F_F Suspend output. + + _T_C_O_O_N Restart suspended output. + + _T_C_I_O_F_F Transmit a STOP character, which is intended to cause the termi- + nal to stop transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + _T_C_I_O_N Transmit a START character, which is intended to cause the termi- + nal to start transmitting data to the system. (See the descrip- + tion of IXOFF in the `Input Modes' section of termios(4)). + + The ttccfflluusshh function discards any data written to the terminal referenced + by _f_d which has not been transmitted to the terminal, or any data re- + ceived from the terminal but not yet read, depending on the value of + _a_c_t_i_o_n. The value of _a_c_t_i_o_n must be one of the following: + + _T_C_I_F_L_U_S_H Flush data received but not read. + + _T_C_O_F_L_U_S_H Flush data written but not transmitted. + + _T_C_I_O_F_L_U_S_H Flush both data received but not read and data written but not + transmitted. + + The ttccsseennddbbrreeaakk function transmits a continuous stream of zero-valued + bits for four-tenths of a second to the terminal referenced by _f_d. The + _l_e_n parameter is ignored in this implementation. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion, all of these functions return a value of ze- + ro. + +EERRRROORRSS + If any error occurs, a value of -1 is returned and the global variable + _e_r_r_n_o is set to indicate the error, as follows: + + + [EBADF] The _f_d argument is not a valid file descriptor. + + [EINVAL] The _a_c_t_i_o_n argument is not a proper value. + + [ENOTTY] The file associated with _f_d is not a terminal. + + [EINTR] A signal interrupted the ttccddrraaiinn function. + +SSEEEE AALLSSOO + tcsetattr(3), termios(4) + +SSTTAANNDDAARRDDSS + The ttccsseennddbbrreeaakk, ttccddrraaiinn, ttccfflluusshh and ttccffllooww functions are expected to be + compliant with the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/tcsetattr.0 b/usr/share/man/cat3/tcsetattr.0 new file mode 100644 index 0000000000..c501ace295 --- /dev/null +++ b/usr/share/man/cat3/tcsetattr.0 @@ -0,0 +1,177 @@ +TCSETATTR(3) BSD Programmer's Manual TCSETATTR(3) + +NNAAMMEE + ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ccffsseettssppeeeedd, + ccffmmaakkeerraaww, ttccggeettaattttrr, ttccsseettaattttrr - manipulating the termios structure + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _s_p_e_e_d___t + ccffggeettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettiissppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _s_p_e_e_d___t + ccffggeettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ccffsseettoossppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffsseettssppeeeedd(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t, _s_p_e_e_d___t _s_p_e_e_d); + + _v_o_i_d + ccffmmaakkeerraaww(_s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccggeettaattttrr(_i_n_t _f_d, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + + _i_n_t + ttccsseettaattttrr(_i_n_t _f_d, _i_n_t _a_c_t_i_o_n, _s_t_r_u_c_t _t_e_r_m_i_o_s _*_t); + +DDEESSCCRRIIPPTTIIOONN + The ccffmmaakkeerraaww, ttccggeettaattttrr and ttccsseettaattttrr functions are provided for getting + and setting the termios structure. + + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd and ccffsseettssppeeeedd + functions are provided for getting and setting the baud rate values in + the termios structure. The effects of the functions on the terminal as + described below do not become effective, nor are all errors detected, un- + til the ttccsseettaattttrr function is called. Certain values for baud rates set + in the termios structure and passed to ttccsseettaattttrr have special meanings. + These are discussed in the portion of the manual page that describes the + ttccsseettaattttrr function. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE BBAAUUDD RRAATTEE + The input and output baud rates are found in the termios structure. The + unsigned integer speed_t is typdef'd in the include file <_t_e_r_m_i_o_s_._h>. The + value of the integer corresponds directly to the baud rate being repre- + sented, however, the following symbolic values are defined. + + #define B0 0 + #define B50 50 + #define B75 75 + #define B110 110 + #define B134 134 + #define B150 150 + #define B200 200 + #define B300 300 + #define B600 600 + #define B1200 1200 + #define B1800 1800 + #define B2400 2400 + #define B4800 4800 + #define B9600 9600 + #define B19200 19200 + #define B38400 38400 + #ifndef _POSIX_SOURCE + #define EXTA 19200 + #define EXTB 38400 + #endif /*_POSIX_SOURCE */ + + The ccffggeettiissppeeeedd function returns the input baud rate in the termios + structure referenced by _t_p. + + The ccffsseettiissppeeeedd function sets the input baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffggeettoossppeeeedd function returns the output baud rate in the termios + structure referenced by _t_p. + + The ccffsseettoossppeeeedd function sets the output baud rate in the termios struc- + ture referenced by _t_p to _s_p_e_e_d. + + The ccffsseettssppeeeedd function sets both the input and output baud rate in the + termios structure referenced by _t_p to _s_p_e_e_d. + + Upon successful completion, the functions ccffsseettiissppeeeedd, ccffsseettoossppeeeedd, and + ccffsseettssppeeeedd return a value of 0. Otherwise, a value of -1 is returned and + the global variable _e_r_r_n_o is set to indicate the error. + +GGEETTTTIINNGG AANNDD SSEETTTTIINNGG TTHHEE TTEERRMMIIOOSS SSTTAATTEE + This section describes the functions that are used to control the general + terminal interface. Unless otherwise noted for a specific command, these + functions are restricted from use by background processes. Attempts to + perform these operations shall cause the process group to be sent a SIGT- + TOU signal. If the calling process is blocking or ignoring SIGTTOU sig- + nals, the process is allowed to perform the operation and the SIGTTOU + signal is not sent. + + In all the functions, although _f_d is an open file descriptor, the func- + tions affect the underlying terminal file, not just the open file de- + scription associated with the particular file descriptor. + + The ccffmmaakkeerraaww function sets the flags stored in the termios structure to + a state disabling all input and output processing, giving a ``raw I/O + path.'' It should be noted that there is no function to reverse this ef- + fect. This is because there are a variety of processing options that + could be re-enabled and the correct method is for an application to snap- + shot the current terminal state using the function ttccggeettaattttrr, setting raw + mode with ccffmmaakkeerraaww and the subsequent ttccsseettaattttrr, and then using another + ttccsseettaattttrr with the saved state to revert to the previous terminal state. + + The ttccggeettaattttrr function copies the parameters associated with the terminal + referenced by _f_d in the termios structure referenced by _t_p. This function + is allowed from a background process, however, the terminal attributes + may be subsequently changed by a foreground process. + + The ttccsseettaattttrr function sets the parameters associated with the terminal + from the termios structure referenced by _t_p. The _a_c_t_i_o_n field is created + by _o_r'ing the following values, as specified in the include file + <_t_e_r_m_i_o_s_._h>. + + _T_C_S_A_N_O_W The change occurs immediately. + + _T_C_S_A_D_R_A_I_N The change occurs after all output written to _f_d has been + transmitted to the terminal. This value of _a_c_t_i_o_n should be + used when changing parameters that affect output. + + _T_C_S_A_F_L_U_S_H The change occurs after all output written to _f_d has been + transmitted to the terminal Additionally, any input that has + been received but not read is discarded. + + _T_C_S_A_S_O_F_T If this value is _o_r'ed into the _a_c_t_i_o_n value, the values of + the _c___c_f_l_a_g, _c___i_s_p_e_e_d, and _c___o_s_p_e_e_d fields are ignored. + + The 0 baud rate is used to terminate the connection. If 0 is specified + as the output speed to the function ttccsseettaattttrr, modem control will no + longer be asserted on the terminal, disconnecting the terminal. + + If zero is specified as the input speed to the function ttccsseettaattttrr, the + input baud rate will be set to the same value as that specified by the + output baud rate. + + If ttccsseettaattttrr is unable able to make any of the requested changes, it re- + turns -1 and sets errno. Otherwise, it makes all of the requested + changes it can. If the specified input and output baud rates differ and + are a combination that is not supported, neither baud rate is changed. + + Upon successful completion, the functions ttccggeettaattttrr and ttccsseettaattttrr return + a value of 0. Otherwise, they return -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument to ttccggeettaattttrr or ttccsseettaattttrr was not a valid + file descriptor. + + [EINTR] The ttccsseettaattttrr function was interrupted by a signal. + + [EINVAL] The _a_c_t_i_o_n argument to the ttccsseettaattttrr function was not + valid, or an attempt was made to change an attribute repre- + sented in the termios structure to an unsupported value. + + [ENOTTY] The file associated with the _f_d argument to ttccggeettaattttrr or + ttccsseettaattttrr is not a terminal. + +SSEEEE AALLSSOO + tcsendbreak(3), termios(4) + +SSTTAANNDDAARRDDSS + The ccffggeettiissppeeeedd, ccffsseettiissppeeeedd, ccffggeettoossppeeeedd, ccffsseettoossppeeeedd, ttccggeettaattttrr and + ttccsseettaattttrr functions are expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. The ccffmmaakkeerraaww and ccffsseettssppeeeedd + functions, as well as the TCSASOFT option to the ttccsseettaattttrr function are + extensions to the IEEE Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/tcsetpgrp.0 b/usr/share/man/cat3/tcsetpgrp.0 new file mode 100644 index 0000000000..a840894351 --- /dev/null +++ b/usr/share/man/cat3/tcsetpgrp.0 @@ -0,0 +1,47 @@ +TCSETPGRP(3) BSD Programmer's Manual TCSETPGRP(3) + +NNAAMMEE + ttccsseettppggrrpp - set foreground process group ID + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + ttccsseettppggrrpp(_i_n_t _f_d, _p_i_d___t _p_g_r_p___i_d); + +DDEESSCCRRIIPPTTIIOONN + If the process has a controlling terminal, the ttccsseettppggrrpp function sets + the foreground process group ID associated with the terminal device to + _p_g_r_p___i_d. The terminal device associated with _f_d must be the controlling + terminal of the calling process and the controlling terminal must be cur- + rently associated with the session of the calling process. The value of + _p_g_r_p___i_d must be the same as the process group ID of a process in the same + session as the calling process. + + Upon successful completion, ttccsseettppggrrpp returns a value of zero. + +EERRRROORRSS + If an error occurs, ttccggeettppggrrpp returns -1 and the global variable _e_r_r_n_o is + set to indicate the error, as follows: + + [EBADF] The _f_d argument is not a valid file descriptor. + + [EINVAL] An invalid value of _p_g_r_p___i_d was specified. + + [ENOTTY] The calling process does not have a controlling terminal, + or the file represented by _f_d is not the controlling termi- + nal, or the controlling terminal is no longer associated + with the session of the calling process. + + [EPERM] The _p_g_r_p___i_d argument does not match the process group ID of + a process in the same session as the calling process. + +SSEEEE AALLSSOO + setpgid(3), setsid(2), tcgetpgrp(3) + +SSTTAANNDDAARRDDSS + The ttccsseettppggpprrpp function is expected to be compliant with the IEEE + Std1003.1-1988 (``POSIX'') specification. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/telldir.0 b/usr/share/man/cat3/telldir.0 new file mode 100644 index 0000000000..47019e2ccd --- /dev/null +++ b/usr/share/man/cat3/telldir.0 @@ -0,0 +1,86 @@ +DIRECTORY(3) BSD Programmer's Manual DIRECTORY(3) + +NNAAMMEE + ooppeennddiirr, rreeaaddddiirr, tteellllddiirr, sseeeekkddiirr, rreewwiinnddddiirr, cclloosseeddiirr, ddiirrffdd - directo- + ry operations + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _D_I_R _* + ooppeennddiirr(_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e); + + _s_t_r_u_c_t _d_i_r_e_n_t _* + rreeaaddddiirr(_D_I_R _*_d_i_r_p); + + _l_o_n_g + tteellllddiirr(_c_o_n_s_t _D_I_R _*_d_i_r_p); + + _v_o_i_d + sseeeekkddiirr(_D_I_R _*_d_i_r_p, _l_o_n_g _l_o_c); + + _v_o_i_d + rreewwiinnddddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + cclloosseeddiirr(_D_I_R _*_d_i_r_p); + + _i_n_t + ddiirrffdd(_D_I_R _*_d_i_r_p); + +DDEESSCCRRIIPPTTIIOONN + The ooppeennddiirr() function opens the directory named by _f_i_l_e_n_a_m_e, associates + a _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m with it and returns a pointer to be used to identify + the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m in subsequent operations. The pointer NULL is re- + turned if _f_i_l_e_n_a_m_e cannot be accessed, or if it cannot malloc(3) enough + memory to hold the whole thing. + + The rreeaaddddiirr() function returns a pointer to the next directory entry. It + returns NULL upon reaching the end of the directory or detecting an in- + valid sseeeekkddiirr() operation. + + The tteellllddiirr() function returns the current location associated with the + named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. + + The sseeeekkddiirr() function sets the position of the next rreeaaddddiirr() operation + on the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m. The new position reverts to the one associated + with the _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m when the tteellllddiirr() operation was performed. + Values returned by tteellllddiirr() are good only for the lifetime of the DIR + pointer, _d_i_r_p, from which they are derived. If the directory is closed + and then reopened, the tteellllddiirr() value may be invalidated due to unde- + tected directory compaction. It is safe to use a previous tteellllddiirr() val- + ue immediately after a call to ooppeennddiirr() and before any calls to + rreeaaddddiirr(). + + The rreewwiinnddddiirr() function resets the position of the named _d_i_r_e_c_t_o_r_y + _s_t_r_e_a_m to the beginning of the directory. + + The cclloosseeddiirr() function closes the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m and frees the + structure associated with the _d_i_r_p pointer, returning 0 on success. On + failure, -1 is returned and the global variable _e_r_r_n_o is set to indicate + the error. + + The ddiirrffdd() function returns the integer file descriptor associated with + the named _d_i_r_e_c_t_o_r_y _s_t_r_e_a_m, see open(2). + + Sample code which searchs a directory for entry ``name'' is: + + len = strlen(name); + dirp = opendir("."); + while ((dp = readdir(dirp)) != NULL) + if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { + (void)closedir(dirp); + return FOUND; + } + (void)closedir(dirp); + return NOT_FOUND; + +SSEEEE AALLSSOO + open(2), close(2), read(2), lseek(2), dir(5) + +HHIISSTTOORRYY + The ooppeennddiirr(), rreeaaddddiirr(), tteellllddiirr(), sseeeekkddiirr(), rreewwiinnddddiirr(), cclloosseeddiirr(), + and ddiirrffdd() functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 2 diff --git a/usr/share/man/cat3/tempnam.0 b/usr/share/man/cat3/tempnam.0 new file mode 100644 index 0000000000..ae9327bf97 --- /dev/null +++ b/usr/share/man/cat3/tempnam.0 @@ -0,0 +1,95 @@ +TMPFILE(3) BSD Programmer's Manual TMPFILE(3) + +NNAAMMEE + tteemmppnnaamm, ttmmppffiillee, ttmmppnnaamm - temporary file routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ttmmppffiillee(_v_o_i_d); + + _c_h_a_r _* + ttmmppnnaamm(_c_h_a_r _*_s_t_r); + + _c_h_a_r _* + tteemmppnnaamm(_c_o_n_s_t _c_h_a_r _*_t_m_p_d_i_r, _c_o_n_s_t _c_h_a_r _*_p_r_e_f_i_x); + +DDEESSCCRRIIPPTTIIOONN + The ttmmppffiillee() function returns a pointer to a stream associated with a + file descriptor returned by the routine mkstemp(3). The created file is + unlinked before ttmmppffiillee() returns, causing the file to be automatically + deleted when the last reference to it is closed. The file is opened with + the access value `w+'. + + The ttmmppnnaamm() function returns a pointer to a file name, in the P_tmpdir + directory, which did not reference an existing file at some indeterminate + point in the past. P_tmpdir is defined in the include file <_s_t_d_i_o_._h>. If + the argument _s is non-NULL, the file name is copied to the buffer it ref- + erences. Otherwise, the file name is copied to a static buffer. In ei- + ther case, ttmmppnnaamm() returns a pointer to the file name. + + The buffer referenced by _s is expected to be at least L_tmpnam bytes in + length. L_tmpnam is defined in the include file <_s_t_d_i_o_._h>. + + The tteemmppnnaamm() function is similar to ttmmppnnaamm(), but provides the ability + to specify the directory which will contain the temporary file and the + file name prefix. + + The environment variable TMPDIR (if set), the argument _d_i_r (if non-NULL), + the directory P_tmpdir, and the directory _/_t_m_p are tried, in the listed + order, as directories in which to store the temporary file. + + The argument _p_r_e_f_i_x, if non-NULL, is used to specify a file name prefix, + which will be the first part of the created file name. TTeemmppnnaamm() allo- + cates memory in which to store the file name; the returned pointer may be + used as a subsequent argument to free(3). + +RREETTUURRNN VVAALLUUEESS + The ttmmppffiillee() function returns a pointer to an open file stream on suc- + cess, and a NULL pointer on error. + + The ttmmppnnaamm() and tteemmppffiillee() functions return a pointer to a file name on + success, and a NULL pointer on error. + +EERRRROORRSS + The ttmmppffiillee() function may fail and set the global variable _e_r_r_n_o for any + of the errors specified for the library functions fdopen(3) or + mkstemp(3). + + The ttmmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function mktemp(3). + + The tteemmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors spec- + ified for the library functions malloc(3) or mktemp(3). + +SSEEEE AALLSSOO + mkstemp(3), mktemp(3) + +SSTTAANNDDAARRDDSS + The ttmmppffiillee() and ttmmppnnaamm() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + These interfaces are provided for System V and ANSI compatibility only. + The mkstemp(3) interface is strongly preferred. + + There are four important problems with these interfaces (as well as with + the historic mktemp(3) interface). First, there is an obvious race be- + tween file name selection and file creation and deletion. Second, most + historic implementations provide only a limited number of possible tempo- + rary file names (usually 26) before file names will start being recycled. + Third, the System V implementations of these functions (and of mktemp) + use the access(2) function to determine whether or not the temporary file + may be created. This has obvious ramifications for setuid or setgid pro- + grams, complicating the portable use of these interfaces in such pro- + grams. Finally, there is no specification of the permissions with which + the temporary files are created. + + This implementation does not have these flaws, but portable software can- + not depend on that. In particular, the ttmmppffiillee() interface should not be + used in software expected to be used on other systems if there is any + possibility that the user does not wish the temporary file to be publicly + readable and writable. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/time.0 b/usr/share/man/cat3/time.0 new file mode 100644 index 0000000000..9a5a40400b --- /dev/null +++ b/usr/share/man/cat3/time.0 @@ -0,0 +1,34 @@ +TIME(3) BSD Programmer's Manual TIME(3) + +NNAAMMEE + ttiimmee - get time of day + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _t_i_m_e___t + ttiimmee(_t_i_m_e___t _*_t_l_o_c); + +DDEESSCCRRIIPPTTIIOONN + The ttiimmee() function returns the value of time in seconds since 0 hours, 0 + minutes, 0 seconds, January 1, 1970, Coordinated Universal Time. + + A copy of the time value may be saved to the area indicated by the point- + er _t_l_o_c. If _t_l_o_c is a NULL pointer, no value is stored. + + Upon successful completion, ttiimmee() returns the value of time. Otherwise + a value of ((_t_i_m_e___t) -1) is returned and the global variable _e_r_r_n_o is set + to indicate the error. + +EERRRROORRSS + The following error codes may be set in _e_r_r_n_o: + + [EFAULT] An argument address referenced invalid memory. + +SSEEEE AALLSSOO + gettimeofday(2), ctime(3) + +HHIISSTTOORRYY + A ttiimmee() function appeared in Version 6 AT&T UNIX. + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/times.0 b/usr/share/man/cat3/times.0 new file mode 100644 index 0000000000..d99d6dc8dd --- /dev/null +++ b/usr/share/man/cat3/times.0 @@ -0,0 +1,63 @@ +TIMES(3) BSD Programmer's Manual TIMES(3) + +NNAAMMEE + ttiimmeess - process times + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_l_o_c_k___t + ttiimmeess(_s_t_r_u_c_t _t_m_s _*_t_p); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ggeettrruussaaggee((22)) aanndd ggeettttiimmeeooffddaayy((33)).. + + The ttiimmeess() function returns the value of time in CLK_TCK's of a second + since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Univer- + sal Time. + + It also fills in the structure pointed to by _t_p with time-accounting in- + formation. + + The _t_m_s structure is defined as follows: + + typedef struct { + clock_t tms_utime; + clock_t tms_stime; + clock_t tms_cutime; + clock_t tms_cstime; + } + + The elements of this structure are defined as follows: + + _t_m_s___u_t_i_m_e The CPU time charged for the execution of user instructions. + + _t_m_s___s_t_i_m_e The CPU time charged for execution by the system on behalf of + the process. + + _t_m_s___c_u_t_i_m_e The sum of the _t_m_s___u_t_i_m_e _s and _t_m_s___c_u_t_i_m_e _s of the child pro- + cesses. + + _t_m_s___c_s_t_i_m_e The sum of the _t_m_s___s_t_i_m_es and _t_m_s___c_s_t_i_m_es of the child pro- + cesses. + + All times are in CLK_TCK's of a second. + + The times of a terminated child process are included in the _t_m_s___c_u_t_i_m_e + and _t_m_s___c_s_t_i_m_e elements of the parent when one of the wait(2) functions + returns the process ID of the terminated child to the parent. If an er- + ror occurs, ttiimmeess() returns the value ((clock_t)-1), and sets errno to + indicate the error. + +EERRRROORRSS + The ttiimmeess() function may fail and set the global variable _e_r_r_n_o for any + of the errors specified for the library routines getrusage(2) and + gettimeofday(2). + +SSEEEE AALLSSOO + time(1), getrusage(2), gettimeofday(2), wait(2) + +SSTTAANNDDAARRDDSS + The ttiimmeess() function conforms to IEEE Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/timezone.0 b/usr/share/man/cat3/timezone.0 new file mode 100644 index 0000000000..4aeaeb8fbb --- /dev/null +++ b/usr/share/man/cat3/timezone.0 @@ -0,0 +1,24 @@ +TIMEZONE(3) BSD Programmer's Manual TIMEZONE(3) + +NNAAMMEE + ttiimmeezzoonnee - return the timezone abbreviation + +SSYYNNOOPPSSIISS + _c_h_a_r _* + ttiimmeezzoonnee(_i_n_t _z_o_n_e, _i_n_t _d_s_t); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss ffoorr ccoommppaattiibbiilliittyy oonnllyy;; iitt iiss iimmppoossssiibbllee ttoo rreelliiaabbllyy + mmaapp ttiimmeezzoonnee''ss aarrgguummeennttss ttoo aa ttiimmee zzoonnee aabbbbrreevviiaattiioonn.. SSeeee ccttiimmee((33)).. + + The ttiimmeezzoonnee() function returns a pointer to a time zone abbreviation for + the specifed _z_o_n_e and _d_s_t values. _Z_o_n_e is the number of minutes west of + GMT and _d_s_t is non-zero if daylight savings time is in effect. + +SSEEEE AALLSSOO + ctime(3) + +HHIISSTTOORRYY + A ttiimmeezzoonnee() function appeared in Version 7 AT&T UNIX. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tmpfile.0 b/usr/share/man/cat3/tmpfile.0 new file mode 100644 index 0000000000..ae9327bf97 --- /dev/null +++ b/usr/share/man/cat3/tmpfile.0 @@ -0,0 +1,95 @@ +TMPFILE(3) BSD Programmer's Manual TMPFILE(3) + +NNAAMMEE + tteemmppnnaamm, ttmmppffiillee, ttmmppnnaamm - temporary file routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ttmmppffiillee(_v_o_i_d); + + _c_h_a_r _* + ttmmppnnaamm(_c_h_a_r _*_s_t_r); + + _c_h_a_r _* + tteemmppnnaamm(_c_o_n_s_t _c_h_a_r _*_t_m_p_d_i_r, _c_o_n_s_t _c_h_a_r _*_p_r_e_f_i_x); + +DDEESSCCRRIIPPTTIIOONN + The ttmmppffiillee() function returns a pointer to a stream associated with a + file descriptor returned by the routine mkstemp(3). The created file is + unlinked before ttmmppffiillee() returns, causing the file to be automatically + deleted when the last reference to it is closed. The file is opened with + the access value `w+'. + + The ttmmppnnaamm() function returns a pointer to a file name, in the P_tmpdir + directory, which did not reference an existing file at some indeterminate + point in the past. P_tmpdir is defined in the include file <_s_t_d_i_o_._h>. If + the argument _s is non-NULL, the file name is copied to the buffer it ref- + erences. Otherwise, the file name is copied to a static buffer. In ei- + ther case, ttmmppnnaamm() returns a pointer to the file name. + + The buffer referenced by _s is expected to be at least L_tmpnam bytes in + length. L_tmpnam is defined in the include file <_s_t_d_i_o_._h>. + + The tteemmppnnaamm() function is similar to ttmmppnnaamm(), but provides the ability + to specify the directory which will contain the temporary file and the + file name prefix. + + The environment variable TMPDIR (if set), the argument _d_i_r (if non-NULL), + the directory P_tmpdir, and the directory _/_t_m_p are tried, in the listed + order, as directories in which to store the temporary file. + + The argument _p_r_e_f_i_x, if non-NULL, is used to specify a file name prefix, + which will be the first part of the created file name. TTeemmppnnaamm() allo- + cates memory in which to store the file name; the returned pointer may be + used as a subsequent argument to free(3). + +RREETTUURRNN VVAALLUUEESS + The ttmmppffiillee() function returns a pointer to an open file stream on suc- + cess, and a NULL pointer on error. + + The ttmmppnnaamm() and tteemmppffiillee() functions return a pointer to a file name on + success, and a NULL pointer on error. + +EERRRROORRSS + The ttmmppffiillee() function may fail and set the global variable _e_r_r_n_o for any + of the errors specified for the library functions fdopen(3) or + mkstemp(3). + + The ttmmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function mktemp(3). + + The tteemmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors spec- + ified for the library functions malloc(3) or mktemp(3). + +SSEEEE AALLSSOO + mkstemp(3), mktemp(3) + +SSTTAANNDDAARRDDSS + The ttmmppffiillee() and ttmmppnnaamm() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + These interfaces are provided for System V and ANSI compatibility only. + The mkstemp(3) interface is strongly preferred. + + There are four important problems with these interfaces (as well as with + the historic mktemp(3) interface). First, there is an obvious race be- + tween file name selection and file creation and deletion. Second, most + historic implementations provide only a limited number of possible tempo- + rary file names (usually 26) before file names will start being recycled. + Third, the System V implementations of these functions (and of mktemp) + use the access(2) function to determine whether or not the temporary file + may be created. This has obvious ramifications for setuid or setgid pro- + grams, complicating the portable use of these interfaces in such pro- + grams. Finally, there is no specification of the permissions with which + the temporary files are created. + + This implementation does not have these flaws, but portable software can- + not depend on that. In particular, the ttmmppffiillee() interface should not be + used in software expected to be used on other systems if there is any + possibility that the user does not wish the temporary file to be publicly + readable and writable. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/tmpnam.0 b/usr/share/man/cat3/tmpnam.0 new file mode 100644 index 0000000000..ae9327bf97 --- /dev/null +++ b/usr/share/man/cat3/tmpnam.0 @@ -0,0 +1,95 @@ +TMPFILE(3) BSD Programmer's Manual TMPFILE(3) + +NNAAMMEE + tteemmppnnaamm, ttmmppffiillee, ttmmppnnaamm - temporary file routines + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + ttmmppffiillee(_v_o_i_d); + + _c_h_a_r _* + ttmmppnnaamm(_c_h_a_r _*_s_t_r); + + _c_h_a_r _* + tteemmppnnaamm(_c_o_n_s_t _c_h_a_r _*_t_m_p_d_i_r, _c_o_n_s_t _c_h_a_r _*_p_r_e_f_i_x); + +DDEESSCCRRIIPPTTIIOONN + The ttmmppffiillee() function returns a pointer to a stream associated with a + file descriptor returned by the routine mkstemp(3). The created file is + unlinked before ttmmppffiillee() returns, causing the file to be automatically + deleted when the last reference to it is closed. The file is opened with + the access value `w+'. + + The ttmmppnnaamm() function returns a pointer to a file name, in the P_tmpdir + directory, which did not reference an existing file at some indeterminate + point in the past. P_tmpdir is defined in the include file <_s_t_d_i_o_._h>. If + the argument _s is non-NULL, the file name is copied to the buffer it ref- + erences. Otherwise, the file name is copied to a static buffer. In ei- + ther case, ttmmppnnaamm() returns a pointer to the file name. + + The buffer referenced by _s is expected to be at least L_tmpnam bytes in + length. L_tmpnam is defined in the include file <_s_t_d_i_o_._h>. + + The tteemmppnnaamm() function is similar to ttmmppnnaamm(), but provides the ability + to specify the directory which will contain the temporary file and the + file name prefix. + + The environment variable TMPDIR (if set), the argument _d_i_r (if non-NULL), + the directory P_tmpdir, and the directory _/_t_m_p are tried, in the listed + order, as directories in which to store the temporary file. + + The argument _p_r_e_f_i_x, if non-NULL, is used to specify a file name prefix, + which will be the first part of the created file name. TTeemmppnnaamm() allo- + cates memory in which to store the file name; the returned pointer may be + used as a subsequent argument to free(3). + +RREETTUURRNN VVAALLUUEESS + The ttmmppffiillee() function returns a pointer to an open file stream on suc- + cess, and a NULL pointer on error. + + The ttmmppnnaamm() and tteemmppffiillee() functions return a pointer to a file name on + success, and a NULL pointer on error. + +EERRRROORRSS + The ttmmppffiillee() function may fail and set the global variable _e_r_r_n_o for any + of the errors specified for the library functions fdopen(3) or + mkstemp(3). + + The ttmmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function mktemp(3). + + The tteemmppnnaamm() function may fail and set _e_r_r_n_o for any of the errors spec- + ified for the library functions malloc(3) or mktemp(3). + +SSEEEE AALLSSOO + mkstemp(3), mktemp(3) + +SSTTAANNDDAARRDDSS + The ttmmppffiillee() and ttmmppnnaamm() functions conform to ANSI C X3.159-1989 + (``ANSI C ''). + +BBUUGGSS + These interfaces are provided for System V and ANSI compatibility only. + The mkstemp(3) interface is strongly preferred. + + There are four important problems with these interfaces (as well as with + the historic mktemp(3) interface). First, there is an obvious race be- + tween file name selection and file creation and deletion. Second, most + historic implementations provide only a limited number of possible tempo- + rary file names (usually 26) before file names will start being recycled. + Third, the System V implementations of these functions (and of mktemp) + use the access(2) function to determine whether or not the temporary file + may be created. This has obvious ramifications for setuid or setgid pro- + grams, complicating the portable use of these interfaces in such pro- + grams. Finally, there is no specification of the permissions with which + the temporary files are created. + + This implementation does not have these flaws, but portable software can- + not depend on that. In particular, the ttmmppffiillee() interface should not be + used in software expected to be used on other systems if there is any + possibility that the user does not wish the temporary file to be publicly + readable and writable. + +4.4BSD June 4, 1993 2 diff --git a/usr/share/man/cat3/toascii.0 b/usr/share/man/cat3/toascii.0 new file mode 100644 index 0000000000..14f14f2a80 --- /dev/null +++ b/usr/share/man/cat3/toascii.0 @@ -0,0 +1,24 @@ +TOASCII(3) BSD Programmer's Manual TOASCII(3) + +NNAAMMEE + ttooaasscciiii - convert a byte to 7-bit ASCII + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttooaasscciiii(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The ttooaasscciiii() function strips all but the low 7 bits from a letter, in- + cluding parity or other marker bits. + +RREETTUURRNN VVAALLUUEESS + The ttooaasscciiii() function always returns a valid ASCII character. + +SSEEEE AALLSSOO + isascii(3), isalnum(3), isalpha(3), iscntrl(3), isdigit(3), + isgraph(3), islower(3), isprint(3), ispunct(3), isspace(3), + isupper(3), isxdigit(3), tolower(3), toupper(3), stdio(3), ascii(7) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tolower.0 b/usr/share/man/cat3/tolower.0 new file mode 100644 index 0000000000..3e3f963d2d --- /dev/null +++ b/usr/share/man/cat3/tolower.0 @@ -0,0 +1,29 @@ +TOLOWER(3) BSD Programmer's Manual TOLOWER(3) + +NNAAMMEE + ttoolloowweerr - upper case to lower case letter conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttoolloowweerr(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The ttoolloowweerr() function converts an upper-case letter to the corresponding + lower-case letter. + +RREETTUURRNN VVAALLUUEESS + If the argument is an upper-case letter, the ttoolloowweerr() function returns + the corresponding lower-case letter if there is one; otherwise the argu- + ment is returned unchanged. + +SSEEEE AALLSSOO + isascii(3), isalnum(3), isalpha(3), iscntrl(3), isdigit(3), + isgraph(3), islower(3), isprint(3), ispunct(3), isspace(3), + isupper(3), isxdigit(3), toascii(3), toupper(3), stdio(3) ascii(7) + +SSTTAANNDDAARRDDSS + The ttoolloowweerr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/toupper.0 b/usr/share/man/cat3/toupper.0 new file mode 100644 index 0000000000..a9054d0a16 --- /dev/null +++ b/usr/share/man/cat3/toupper.0 @@ -0,0 +1,26 @@ +TOUPPER(3) BSD Programmer's Manual TOUPPER(3) + +NNAAMMEE + ttoouuppppeerr - lower case to upper case letter conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ttoouuppppeerr(_i_n_t _c); + +DDEESSCCRRIIPPTTIIOONN + The ttoouuppppeerr() function converts a lower-case letter to the corresponding + upper-case letter. If the argument is a lower-case letter, the ttoouuppppeerr() + function returns the corresponding upper-case letter if there is one; + otherwise the argument is returned unchanged. + +SSEEEE AALLSSOO + isascii(3), isalnum(3), isalpha(3), iscntrl(3), isdigit(3), + isgraph(3), islower(3), isprint(3), ispunct(3), isspace(3), + isupper(3), isxdigit(3), toascii(3), toupper(3), stdio(3) ascii(7) + +SSTTAANNDDAARRDDSS + The ttoolloowweerr() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ttyname.0 b/usr/share/man/cat3/ttyname.0 new file mode 100644 index 0000000000..ab04f37410 --- /dev/null +++ b/usr/share/man/cat3/ttyname.0 @@ -0,0 +1,58 @@ +TTYNAME(3) BSD Programmer's Manual TTYNAME(3) + +NNAAMMEE + ttttyynnaammee, iissaattttyy, ttttyysslloott - get name of associated terminal (tty) from + file descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ttttyynnaammee(_i_n_t _f_d); + + _i_n_t + iissaattttyy(_i_n_t _f_d); + + _i_n_t + ttttyysslloott(); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the system file descriptors for terminal type + devices. These descriptors are not related to the standard I/O FILE type- + def, but refer to the special device files found in _/_d_e_v and named + _/_d_e_v_/_t_t_y_x_x and for which an entry exists in the initialization file + _/_e_t_c_/_t_t_y_s_. (See ttys(5).) + + The iissaattttyy() function determines if the file descriptor _f_d refers to a + valid terminal type device. + + The ttttyynnaammee() function gets the related device name of a file descriptor + for which iissaattttyy() is true + + The ttttyysslloott() function fetches the current process' control terminal num- + ber from the ttys(5) file entry. + +RREETTUURRNN VVAALLUUEESS + The ttttyynnaammee() function returns the null terminated name if the device is + found and iissaattttyy() is true; otherwise a NULL pointer is returned. + + The ttttyysslloott() function returns the unit number of the device file if + found; otherwise the value zero is returned. + +FFIILLEESS + /dev/* + /etc/ttys + +SSEEEE AALLSSOO + ioctl(2), ttys(5) + +HHIISSTTOORRYY + A iissaattttyy(), ttttyynnaammee(), and ttttyysslloott() function appeared in Version 7 AT&T + UNIX. + +BBUUGGSS + The ttttyynnaammee() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ttttyynnaammee() will mod- + ify the same object. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/ttyslot.0 b/usr/share/man/cat3/ttyslot.0 new file mode 100644 index 0000000000..ab04f37410 --- /dev/null +++ b/usr/share/man/cat3/ttyslot.0 @@ -0,0 +1,58 @@ +TTYNAME(3) BSD Programmer's Manual TTYNAME(3) + +NNAAMMEE + ttttyynnaammee, iissaattttyy, ttttyysslloott - get name of associated terminal (tty) from + file descriptor + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ttttyynnaammee(_i_n_t _f_d); + + _i_n_t + iissaattttyy(_i_n_t _f_d); + + _i_n_t + ttttyysslloott(); + +DDEESSCCRRIIPPTTIIOONN + These functions operate on the system file descriptors for terminal type + devices. These descriptors are not related to the standard I/O FILE type- + def, but refer to the special device files found in _/_d_e_v and named + _/_d_e_v_/_t_t_y_x_x and for which an entry exists in the initialization file + _/_e_t_c_/_t_t_y_s_. (See ttys(5).) + + The iissaattttyy() function determines if the file descriptor _f_d refers to a + valid terminal type device. + + The ttttyynnaammee() function gets the related device name of a file descriptor + for which iissaattttyy() is true + + The ttttyysslloott() function fetches the current process' control terminal num- + ber from the ttys(5) file entry. + +RREETTUURRNN VVAALLUUEESS + The ttttyynnaammee() function returns the null terminated name if the device is + found and iissaattttyy() is true; otherwise a NULL pointer is returned. + + The ttttyysslloott() function returns the unit number of the device file if + found; otherwise the value zero is returned. + +FFIILLEESS + /dev/* + /etc/ttys + +SSEEEE AALLSSOO + ioctl(2), ttys(5) + +HHIISSTTOORRYY + A iissaattttyy(), ttttyynnaammee(), and ttttyysslloott() function appeared in Version 7 AT&T + UNIX. + +BBUUGGSS + The ttttyynnaammee() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ttttyynnaammee() will mod- + ify the same object. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/tzset.0 b/usr/share/man/cat3/tzset.0 new file mode 100644 index 0000000000..d00aa79190 --- /dev/null +++ b/usr/share/man/cat3/tzset.0 @@ -0,0 +1,144 @@ +TZSET(3) BSD Programmer's Manual TZSET(3) + +NNAAMMEE + ttzzsseett, ttzzsseettwwaallll - initialize time conversion information + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ttzzsseett(_v_o_i_d); + + _v_o_i_d + ttzzsseettwwaallll(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ttzzsseett() function initializes time conversion information used by the + library routine localtime(3). The environment variable TZ specifies how + this is done. + + If TZ does not appear in the environment, the best available approxima- + tion to local wall clock time, as specified by the tzfile(5)-format file + _/_e_t_c_/_l_o_c_a_l_t_i_m_e is used. + + If TZ appears in the environment but its value is a null string, Coordi- + nated Universal Time (UTC) is used (without leap second correction). + + If TZ appears in the environment and its value begins with a colon (`'):, + the rest of its value is used as a pathname of a tzfile(5)-format file + from which to read the time conversion information. If the first charac- + ter of the pathname is a slash (`/') it is used as an absolute pathname; + otherwise, it is used as a pathname relative to the system time conver- + sion information directory. + + If its value does not begin with a colon, it is first used as the path- + name of a file (as described above) from which to read the time conver- + sion information. If that file cannot be read, the value is then inter- + preted as a direct specification (the format is described below) of the + time conversion information. + + If the TZ environment variable does not specify a tzfile(5)-format file + and cannot be interpreted as a direct specification, UTC is used. + + The ttzzsseettwwaallll() function sets things up so that localtime returns the + best available approximation of local wall clock time. + +SSPPEECCIIFFIICCAATTIIOONN FFOORRMMAATT + When TZ is used directly as a specification of the time conversion infor- + mation, it must have the following syntax (spaces inserted for clarity): + + _s_t_d _o_f_f_s_e_t [_d_s_t [_o_f_f_s_e_t] [ , _r_u_l_e]] + + Where: + + _s_t_d and _d_s_t Three or more bytes that are the designation for the + standard (_s_t_d) or summer (_d_s_t) time zone. Only _s_t_d is + required; if _d_s_t is missing, then summer time does not + apply in this locale. Upper and lowercase letters are + explicitly allowed. Any characters except a leading + colon (`'):, digits, comma (`,'), minus (`-'), plus + (`+'), and ASCII NUL are allowed. + + _o_f_f_s_e_t Indicates the value one must add to the local time to + arrive at Coordinated Universal Time. The _o_f_f_s_e_t has + the form: + + _h_h [:_m_m[ : _s_s]] + + The minutes (_m_m) and seconds (_s_s) are optional. The + hour (_h_h) is required and may be a single digit. The + _o_f_f_s_e_t following _s_t_d is required. If no _o_f_f_s_e_t fol- + lows _d_s_t, summer time is assumed to be one hour ahead + of standard time. One or more digits may be used; the + value is always interpreted as a decimal number. The + hour must be between zero and 24, and the minutes (and + seconds) -- if present -- between zero and 59. If + preceded by a (`-') the time zone shall be east of the + Prime Meridian; otherwise it shall be west (which may + be indicated by an optional preceding (`+')). + + _r_u_l_e Indicates when to change to and back from summer time. + The _r_u_l_e has the form: + + _d_a_t_e_/_t_i_m_e_,_d_a_t_e_/_t_i_m_e + + where the first _d_a_t_e describes when the change from + standard to summer time occurs and the second _d_a_t_e de- + scribes when the change back happens. Each _t_i_m_e field + describes when, in current local time, the change to + the other time is made. + + The format of _d_a_t_e is one of the following: + + JJ _n The Julian day _n (1 <= _n <= 365). Leap days + are not counted; that is, in all years -- in- + cluding leap years -- February 28 is day 59 + and March 1 is day 60. It is impossible to + explicitly refer to the occasional February + 29. + + _n The zero-based Julian day (0 <= _n <= 365 ) . + Leap days are counted, and it is possible to + refer to February 29. + + MM _m_._n_._d The _d'th day (0 <= _d <= 6 ) of week _n of + month _m of the year (1 <= _n <= 5), (1 <= _m <= + 12), where week 5 means ``the last _d day in + month _m'' which may occur in either the + fourth or the fifth week). Week 1 is the + first week in which the _d'th day occurs. Day + zero is Sunday. + + The _t_i_m_e has the same format as _o_f_f_s_e_t except + that no leading sign (`-') or (`+') is al- + lowed. The default, if _t_i_m_e is not given, is + 0022::0000::0000. + + If no _r_u_l_e is present in the TZ specification, the + rules specified by the tzfile(5)-format file + _p_o_s_i_x_r_u_l_e_s in the system time conversion information + directory are used, with the standard and summer time + offsets from UTC replaced by those specified by the + _o_f_f_s_e_t values in TZ. + + For compatibility with System V Release 3.1, a semicolon (`'); may be + used to separate the _r_u_l_e from the rest of the specification. + +FFIILLEESS + /etc/localtime local time zone file + /usr/share/zoneinfo time zone directory + + + /usr/share/zoneinfo/posixrules rules for POSIX-style TZ's + /usr/share/zoneinfo/GMT for UTC leap seconds + + If the file _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_G_M_T does not exist, UTC leap seconds are + loaded from _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_p_o_s_i_x_r_u_l_e_s. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), ctime(3), getenv(3), time(3), tzfile(5) + +HHIISSTTOORRYY + The ttzzsseett and ttzzsseettwwaallll functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 3 diff --git a/usr/share/man/cat3/tzsetwall.0 b/usr/share/man/cat3/tzsetwall.0 new file mode 100644 index 0000000000..d00aa79190 --- /dev/null +++ b/usr/share/man/cat3/tzsetwall.0 @@ -0,0 +1,144 @@ +TZSET(3) BSD Programmer's Manual TZSET(3) + +NNAAMMEE + ttzzsseett, ttzzsseettwwaallll - initialize time conversion information + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + ttzzsseett(_v_o_i_d); + + _v_o_i_d + ttzzsseettwwaallll(_v_o_i_d); + +DDEESSCCRRIIPPTTIIOONN + The ttzzsseett() function initializes time conversion information used by the + library routine localtime(3). The environment variable TZ specifies how + this is done. + + If TZ does not appear in the environment, the best available approxima- + tion to local wall clock time, as specified by the tzfile(5)-format file + _/_e_t_c_/_l_o_c_a_l_t_i_m_e is used. + + If TZ appears in the environment but its value is a null string, Coordi- + nated Universal Time (UTC) is used (without leap second correction). + + If TZ appears in the environment and its value begins with a colon (`'):, + the rest of its value is used as a pathname of a tzfile(5)-format file + from which to read the time conversion information. If the first charac- + ter of the pathname is a slash (`/') it is used as an absolute pathname; + otherwise, it is used as a pathname relative to the system time conver- + sion information directory. + + If its value does not begin with a colon, it is first used as the path- + name of a file (as described above) from which to read the time conver- + sion information. If that file cannot be read, the value is then inter- + preted as a direct specification (the format is described below) of the + time conversion information. + + If the TZ environment variable does not specify a tzfile(5)-format file + and cannot be interpreted as a direct specification, UTC is used. + + The ttzzsseettwwaallll() function sets things up so that localtime returns the + best available approximation of local wall clock time. + +SSPPEECCIIFFIICCAATTIIOONN FFOORRMMAATT + When TZ is used directly as a specification of the time conversion infor- + mation, it must have the following syntax (spaces inserted for clarity): + + _s_t_d _o_f_f_s_e_t [_d_s_t [_o_f_f_s_e_t] [ , _r_u_l_e]] + + Where: + + _s_t_d and _d_s_t Three or more bytes that are the designation for the + standard (_s_t_d) or summer (_d_s_t) time zone. Only _s_t_d is + required; if _d_s_t is missing, then summer time does not + apply in this locale. Upper and lowercase letters are + explicitly allowed. Any characters except a leading + colon (`'):, digits, comma (`,'), minus (`-'), plus + (`+'), and ASCII NUL are allowed. + + _o_f_f_s_e_t Indicates the value one must add to the local time to + arrive at Coordinated Universal Time. The _o_f_f_s_e_t has + the form: + + _h_h [:_m_m[ : _s_s]] + + The minutes (_m_m) and seconds (_s_s) are optional. The + hour (_h_h) is required and may be a single digit. The + _o_f_f_s_e_t following _s_t_d is required. If no _o_f_f_s_e_t fol- + lows _d_s_t, summer time is assumed to be one hour ahead + of standard time. One or more digits may be used; the + value is always interpreted as a decimal number. The + hour must be between zero and 24, and the minutes (and + seconds) -- if present -- between zero and 59. If + preceded by a (`-') the time zone shall be east of the + Prime Meridian; otherwise it shall be west (which may + be indicated by an optional preceding (`+')). + + _r_u_l_e Indicates when to change to and back from summer time. + The _r_u_l_e has the form: + + _d_a_t_e_/_t_i_m_e_,_d_a_t_e_/_t_i_m_e + + where the first _d_a_t_e describes when the change from + standard to summer time occurs and the second _d_a_t_e de- + scribes when the change back happens. Each _t_i_m_e field + describes when, in current local time, the change to + the other time is made. + + The format of _d_a_t_e is one of the following: + + JJ _n The Julian day _n (1 <= _n <= 365). Leap days + are not counted; that is, in all years -- in- + cluding leap years -- February 28 is day 59 + and March 1 is day 60. It is impossible to + explicitly refer to the occasional February + 29. + + _n The zero-based Julian day (0 <= _n <= 365 ) . + Leap days are counted, and it is possible to + refer to February 29. + + MM _m_._n_._d The _d'th day (0 <= _d <= 6 ) of week _n of + month _m of the year (1 <= _n <= 5), (1 <= _m <= + 12), where week 5 means ``the last _d day in + month _m'' which may occur in either the + fourth or the fifth week). Week 1 is the + first week in which the _d'th day occurs. Day + zero is Sunday. + + The _t_i_m_e has the same format as _o_f_f_s_e_t except + that no leading sign (`-') or (`+') is al- + lowed. The default, if _t_i_m_e is not given, is + 0022::0000::0000. + + If no _r_u_l_e is present in the TZ specification, the + rules specified by the tzfile(5)-format file + _p_o_s_i_x_r_u_l_e_s in the system time conversion information + directory are used, with the standard and summer time + offsets from UTC replaced by those specified by the + _o_f_f_s_e_t values in TZ. + + For compatibility with System V Release 3.1, a semicolon (`'); may be + used to separate the _r_u_l_e from the rest of the specification. + +FFIILLEESS + /etc/localtime local time zone file + /usr/share/zoneinfo time zone directory + + + /usr/share/zoneinfo/posixrules rules for POSIX-style TZ's + /usr/share/zoneinfo/GMT for UTC leap seconds + + If the file _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_G_M_T does not exist, UTC leap seconds are + loaded from _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o_/_p_o_s_i_x_r_u_l_e_s. + +SSEEEE AALLSSOO + date(1), gettimeofday(2), ctime(3), getenv(3), time(3), tzfile(5) + +HHIISSTTOORRYY + The ttzzsseett and ttzzsseettwwaallll functions first appeared in 4.4BSD. + +4.4BSD June 9, 1993 3 diff --git a/usr/share/man/cat3/ualarm.0 b/usr/share/man/cat3/ualarm.0 new file mode 100644 index 0000000000..c8ea4aaf8c --- /dev/null +++ b/usr/share/man/cat3/ualarm.0 @@ -0,0 +1,35 @@ +UALARM(3) BSD Programmer's Manual UALARM(3) + +NNAAMMEE + uuaallaarrmm - schedule signal after specified time + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _u___i_n_t + uuaallaarrmm(_u___i_n_t _m_i_c_r_o_s_e_c_o_n_d_s, _u___i_n_t _i_n_t_e_r_v_a_l); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iiss aa ssiimmpplliiffiieedd iinntteerrffaaccee ttoo sseettiittiimmeerr((22)).. + + The uuaallaarrmm() function waits a count of _m_i_c_r_o_s_e_c_o_n_d_s before asserting the + terminating signal SIGALRM. System activity or time used in processing + the call may cause a slight delay. + + If the _i_n_t_e_r_v_a_l argument is non-zero, the SIGALRM signal will be sent to + the process every _i_n_t_e_r_v_a_l microseconds after the timer expires (e.g. af- + ter _v_a_l_u_e microseconds have passed). + +RREETTUURRNN VVAALLUUEESS + When the signal has successfully been caught, aallaarrmm() returns the amount + of time left on the clock. The maximum mumber of _m_i_c_r_o_s_e_c_o_n_d_s allowed is + 2147483647. + +SSEEEE AALLSSOO + getitimer(2), setitimer(2), sigpause(2), sigvec(2), signal(3), + sleep(3), alarm(3), usleep(3) + +HHIISSTTOORRYY + The uuaallaarrmm() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/ungetc.0 b/usr/share/man/cat3/ungetc.0 new file mode 100644 index 0000000000..11575ed700 --- /dev/null +++ b/usr/share/man/cat3/ungetc.0 @@ -0,0 +1,38 @@ +UNGETC(3) BSD Programmer's Manual UNGETC(3) + +NNAAMMEE + uunnggeettcc - un-get character from input stream + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + uunnggeettcc(_i_n_t _c, _F_I_L_E _*_s_t_r_e_a_m); + +DDEESSCCRRIIPPTTIIOONN + The uunnggeettcc() function pushes the character _c (converted to an unsigned + char) back onto the input stream pointed to by _s_t_r_e_a_m. The pushed-backed + characters will be returned by subsequent reads on the stream (in reverse + order). A successful intervening call, using the same stream, to one of + the file positioning functions (fseek(3), fsetpos(3), or rewind(3)) + will discard the pushed back characters. + + One character of push-back is guaranteed, but as long as there is suffi- + cient memory, an effectively infinite amount of pushback is allowed. + + If a character is successfully pushed-back, the end-of-file indicator for + the stream is cleared. + +RREETTUURRNN VVAALLUUEESS + The uunnggeettcc() function returns the character pushed-back after the conver- + sion, or EOF if the operation fails. If the value of the argument _c + character equals EOF, the operation will fail and the stream will remain + unchanged. + +SSEEEE AALLSSOO + getc(3), fseek(3), setvbuf(3) + +SSTTAANNDDAARRDDSS + The uunnggeettcc() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/unsetenv.0 b/usr/share/man/cat3/unsetenv.0 new file mode 100644 index 0000000000..950f18b3c3 --- /dev/null +++ b/usr/share/man/cat3/unsetenv.0 @@ -0,0 +1,64 @@ +GETENV(3) BSD Programmer's Manual GETENV(3) + +NNAAMMEE + ggeetteennvv, ppuutteennvv, sseetteennvv, uunnsseetteennvv - environment variable functions + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + ggeetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + + _i_n_t + sseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e, _c_o_n_s_t _c_h_a_r _*_v_a_l_u_e, _i_n_t _o_v_e_r_w_r_i_t_e); + + _i_n_t + ppuutteennvv(_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g); + + _v_o_i_d + uunnsseetteennvv(_c_o_n_s_t _c_h_a_r _*_n_a_m_e); + +DDEESSCCRRIIPPTTIIOONN + These functions set, unset and fetch environment variables from the host + _e_n_v_i_r_o_n_m_e_n_t _l_i_s_t. For compatibility with differing environment conven- + tions, the given arguments _n_a_m_e and _v_a_l_u_e may be appended and prepended, + respectively, with an equal sign ``=''. + + The ggeetteennvv() function obtains the current value of the environment vari- + able, _n_a_m_e. If the variable _n_a_m_e is not in the current environment , a + null pointer is returned. + + The sseetteennvv() function inserts or resets the environment variable _n_a_m_e in + the current environment list. If the variable _n_a_m_e does not exist in the + list, it is inserted with the given _v_a_l_u_e_. If the variable does exist, + the argument _o_v_e_r_w_r_i_t_e is tested; if _o_v_e_r_w_r_i_t_e _i_s zero, the variable is + not reset, otherwise it is reset to the given _v_a_l_u_e. + + The ppuutteennvv() function takes an argument of the form ``name=value'' and is + equivalent to: + + setenv(name, value, 1); + + The uunnsseetteennvv() function deletes all instances of the variable name point- + ed to by _n_a_m_e from the list. + +RREETTUURRNN VVAALLUUEESS + The functions sseetteennvv() and ppuutteennvv() return zero if successful; otherwise + the global variable _e_r_r_n_o is set to indicate the error and a -1 is re- + turned. + +EERRRROORRSS + [ENOMEM] The function sseetteennvv() or ppuutteennvv() failed because they were un- + able to allocate memory for the environment. + +SSEEEE AALLSSOO + csh(1), sh(1), execve(2), environ(7) + +SSTTAANNDDAARRDDSS + The ggeetteennvv() function conforms to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions sseetteennvv() and uunnsseetteennvv() appeared in Version 7 AT&T UNIX. + The ppuutteennvv() function appeared in 4.3BSD-Reno. + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat3/unvis.0 b/usr/share/man/cat3/unvis.0 new file mode 100644 index 0000000000..03b1a72fc4 --- /dev/null +++ b/usr/share/man/cat3/unvis.0 @@ -0,0 +1,92 @@ +UNVIS(3) BSD Programmer's Manual UNVIS(3) + +NNAAMMEE + uunnvviiss, ssttrruunnvviiss - decode a visual representation of characters + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + uunnvviiss(_u___c_h_a_r _*_c_p, _u___c_h_a_r _c, _i_n_t _*_a_s_t_a_t_e, _i_n_t _f_l_a_g); + + _i_n_t + ssttrruunnvviiss(_c_h_a_r _*_d_s_t, _c_h_a_r _*_s_r_c); + +DDEESSCCRRIIPPTTIIOONN + The uunnvviiss() and ssttrruunnvviiss() functions are used to decode a visual repre- + sentation of characters, as produced by the vis(3) function, back into + the original form. Unvis is called with successive characters in _c until + a valid sequence is recognized, at which time the decoded character is + available at the character pointed to by _c_p. Strunvis decodes the charac- + ters pointed to by _s_r_c into the buffer pointed to by _d_s_t. + + The ssttrruunnvviiss() function simply copies _s_r_c to _d_s_t, decoding any escape se- + quences along the way, and returns the number of characters placed into + _d_s_t, or -1 if an invalid escape sequence was detected. The size of _d_s_t + should be equal to the size of _s_r_c (that is, no expansion takes place + during decoding). + + The uunnvviiss() function implements a state machine that can be used to de- + code an arbitrary stream of bytes. All state associated with the bytes + being decoded is stored outside the uunnvviiss() function (that is, a pointer + to the state is passed in), so calls decoding different streams can be + freely intermixed. To start decoding a stream of bytes, first initialize + an integer to zero. Call uunnvviiss() with each successive byte, along with a + pointer to this integer, and a pointer to an destination character. The + unvis function has several return codes that must be handled properly. + They are: + + 0 (zero) Another character is necessary; nothing has been recog- + nized yet. + + UNVIS_VALID A valid character has been recognized and is available + at the location pointed to by cp. + + UNVIS_VALIDPUSH A valid character has been recognized and is available + at the location pointed to by cp; however, the character + currently passed in should be passed in again. + + UNVIS_NOCHAR A valid sequence was detected, but no character was pro- + duced. This return code is necessary to indicate a log- + ical break between characters. + + UNVIS_SYNBAD An invalid esacpe sequence was detected, or the decoder + is in an unknown state. The decoder is placed into the + starting state. + + When all bytes in the stream have been processed, call uunnvviiss() one more + time with flag set to UNVIS_END to extract any remaining character (the + character passed in is ignored). + + The following code fragment illustrates a proper use of uunnvviiss(). + + int state = 0; + char out; + + while ((ch = getchar()) != EOF) { + again: + switch(unvis(&out, ch, &state, 0)) { + case 0: + case UNVIS_NOCHAR: + break; + case UNVIS_VALID: + (void) putchar(out); + break; + case UNVIS_VALIDPUSH: + (void) putchar(out); + goto again; + case UNVIS_SYNBAD: + (void)fprintf(stderr, "bad sequence!0); + exit(1); + } + } + if (unvis(&out, (char)0, &state, UNVIS_END) == UNVIS_VALID) + (void) putchar(out); + +SSEEEE AALLSSOO + vis(1) + +HHIISSTTOORRYY + The uunnvviiss function first appeared in 4.4BSD. + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/user_from_uid.0 b/usr/share/man/cat3/user_from_uid.0 new file mode 100644 index 0000000000..5cffb4cc0f --- /dev/null +++ b/usr/share/man/cat3/user_from_uid.0 @@ -0,0 +1,33 @@ +PWCACHE(3) BSD Programmer's Manual PWCACHE(3) + +NNAAMMEE + ppwwccaacchhee - cache password and group entries + +SSYYNNOOPPSSIISS + uusseerr__ffrroomm__uuiidd(_u_i_d___t _u_i_d, _i_n_t _n_o_u_s_e_r); + + ggrroouupp__ffrroomm__ggiidd(_g_i_d___t _g_i_d, _i_n_t _n_o_g_r_o_u_p); + +DDEESSCCRRIIPPTTIIOONN + The uusseerr__ffrroomm__uuiidd() function returns the user name associated with the + argument _u_i_d. The user name is cached so that multiple calls with the + same _u_i_d do not require additional calls to getpwuid(3). If there is no + user associated with the _u_i_d, a pointer is returned to a string represen- + tation of the _u_i_d, unless the argument _n_o_u_s_e_r is non-zero, in which case + a NULL pointer is returned. + + The ggrroouupp__ffrroomm__ggiidd() function returns the group name associated with the + argument _g_i_d. The group name is cached so that multiple calls with the + same _g_i_d do not require additional calls to getgrgid(3). If there is no + group associated with the _g_i_d, a pointer is returned to a string repre- + sentation of the _g_i_d, unless the argument _n_o_g_r_o_u_p is non-zero, in which + case a NULL pointer is returned. + +SSEEEE AALLSSOO + getgrgid(3), getpwuid(3) + +HHIISSTTOORRYY + The uusseerr__ffrroomm__iidd() and ggrroouupp__ffrroomm__iidd() functions first appeared in + 4.4BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat3/usleep.0 b/usr/share/man/cat3/usleep.0 new file mode 100644 index 0000000000..473c7b253c --- /dev/null +++ b/usr/share/man/cat3/usleep.0 @@ -0,0 +1,35 @@ +USLEEP(3) BSD Programmer's Manual USLEEP(3) + +NNAAMMEE + uusslleeeepp - suspend execution for interval of microseconds + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + uusslleeeepp(_u___i_n_t _m_i_c_r_o_s_e_c_o_n_d_s); + +DDEESSCCRRIIPPTTIIOONN + The uusslleeeepp() function suspends execution of the calling process for + _m_i_c_r_o_s_e_c_o_n_d_s of time. System activity or time spent in processing the + call may lengthen the sleep slightly. + + If a timer is already running on the process its state is saved. If the + value _m_i_c_r_o_s_e_c_o_n_d_s is more than or equal to the remaining clock time for + the saved timer, the sleep time is set to the remaining clock time. The + state of the previous timer is restored after _m_i_c_r_o_s_e_c_o_n_d_s has passed. + + This routine is implemented using setitimer(2); it requires eight system + calls each time it is invoked. A similar but less compatible function + can be obtained with a single select(2); such a function would not + restart after signals, but would not interfere with other uses of + setitimer. + +SSEEEE AALLSSOO + setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), + alarm(3) + +HHIISSTTOORRYY + The uusslleeeepp() function appeared in 4.3BSD. + +4.3 Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/utime.0 b/usr/share/man/cat3/utime.0 new file mode 100644 index 0000000000..d6b51041db --- /dev/null +++ b/usr/share/man/cat3/utime.0 @@ -0,0 +1,39 @@ +UTIME(3) BSD Programmer's Manual UTIME(3) + +NNAAMMEE + uuttiimmee - set file times + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _i_n_t + uuttiimmee(_c_o_n_s_t _c_h_a_r _*_f_i_l_e, _c_o_n_s_t _s_t_r_u_c_t _u_t_i_m_b_u_f _*_t_i_m_e_p); + +DDEESSCCRRIIPPTTIIOONN + TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy uuttiimmeess((22)) .. + + The uuttiimmee() function sets the access and modification times of the named + file from the structures in the argument array _t_i_m_e_p. + + If the times are specified (the _t_i_m_e_p argument is non-NULL) the caller + must be the owner of the file or be the super-user. + + If the times are not specified (the _t_i_m_e_p argument is NULL) the caller + must be the owner of the file, have permission to write the file, or be + the super-user. + +EERRRROORRSS + The uuttiimmee() function may fail and set _e_r_r_n_o for any of the errors speci- + fied for the library function utimes(2). + +SSEEEE AALLSSOO + utimes(2), stat(2) + +HHIISSTTOORRYY + A uuttiimmee() function appeared in Version 7 AT&T UNIX. + +SSTTAANNDDAARRDDSS + The uuttiimmee function conforms to IEEE Std1003.1-1988 (``POSIX''). + +4th Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/valloc.0 b/usr/share/man/cat3/valloc.0 new file mode 100644 index 0000000000..e9a7658339 --- /dev/null +++ b/usr/share/man/cat3/valloc.0 @@ -0,0 +1,31 @@ +VALLOC(3) BSD Programmer's Manual VALLOC(3) + +NNAAMMEE + vvaalllloocc - aligned memory allocation function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + vvaalllloocc(_u_n_s_i_g_n_e_d _s_i_z_e); + +DDEESSCCRRIIPPTTIIOONN + VVaalllloocc iiss oobbssoolleetteedd bbyy tthhee ccuurrrreenntt vveerrssiioonn ooff mmaalllloocc((33)),, wwhhiicchh aalliiggnnss + ppaaggee--ssiizzeedd aanndd llaarrggeerr aallllooccaattiioonnss.. + + The vvaalllloocc() function allocates _s_i_z_e bytes aligned on a page boundary. + It is implemented by calling malloc(3) with a slightly larger request, + saving the true beginning of the block allocated, and returning a proper- + ly aligned pointer. + +RREETTUURRNN VVAALLUUEESS + The vvaalllloocc() function returns a pointer to the allocated space if suc- + cessful; otherwise a null pointer is returned + +HHIISSTTOORRYY + The vvaalllloocc() function appeared in 3.0BSD. + +BBUUGGSS + A _v_f_r_e_e function has not been implemented. + +3rd Berkeley Distribution June 4, 1993 1 diff --git a/usr/share/man/cat3/verr.0 b/usr/share/man/cat3/verr.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/verr.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/verrx.0 b/usr/share/man/cat3/verrx.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/verrx.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/vfprintf.0 b/usr/share/man/cat3/vfprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/vfprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/vfscanf.0 b/usr/share/man/cat3/vfscanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/vfscanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/vis.0 b/usr/share/man/cat3/vis.0 new file mode 100644 index 0000000000..3b8693a2c4 --- /dev/null +++ b/usr/share/man/cat3/vis.0 @@ -0,0 +1,120 @@ +VIS(3) BSD Programmer's Manual VIS(3) + +NNAAMMEE + vviiss - visually encode characters + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _c_h_a_r _* + vviiss(_c_h_a_r _*_d_s_t, _c_h_a_r _c, _i_n_t _f_l_a_g, _c_h_a_r _n_e_x_t_c); + + _i_n_t + ssttrrvviiss(_c_h_a_r _*_d_s_t, _c_h_a_r _*_s_r_c, _i_n_t _f_l_a_g); + + _i_n_t + ssttrrvviissxx(_c_h_a_r _*_d_s_t, _c_h_a_r _*_s_r_c, _i_n_t _l_e_n, _i_n_t _f_l_a_g); + +DDEESSCCRRIIPPTTIIOONN + The vviiss() function copies into _d_s_t a string which represents the charac- + ter _c. If _c needs no encoding, it is copied in unaltered. The string is + null terminated, and a pointer to the end of the string is returned. The + maximum length of any encoding is four characters (not including the + trailing NULL); thus, when encoding a set of characters into a buffer, + the size of the buffer should be four times the number of characters en- + coded, plus one for the trailing NULL. The flag parameter is used for al- + tering the default range of characters considered for encoding and for + altering the visual representation. The additional character, _n_e_x_t_c, is + only used when selecting the VIS_CSTYLE encoding format (explained be- + low). + + The ssttrrvviiss() and ssttrrvviissxx() functions copy into _d_s_t a visual representa- + tion of the string _s_r_c. The ssttrrvviiss() function encodes characters from _s_r_c + up to the first NULL. The ssttrrvviissxx() function encodes exactly _l_e_n charac- + ters from _s_r_c (this is useful for encoding a block of data that may con- + tain NULL's). Both forms NULL terminate _d_s_t. The size of _d_s_t must be four + times the number of characters encoded from _s_r_c (plus one for the NULL). + Both forms return the number of characters in dst (not including the + trailing NULL). + + The encoding is a unique, invertible representation comprised entirely of + graphic characters; it can be decoded back into the original form using + the unvis(3) or strunvis(3) functions. + + There are two parameters that can be controlled: the range of characters + that are encoded, and the type of representation used. By default, all + non-graphic characters. except space, tab, and newline are encoded. + (See isgraph(3).) The following flags alter this: + + VIS_SP Also encode space. + + VIS_TAB + Also encode tab. + + VIS_NL Also encode newline. + + VIS_WHITE Synonym for VIS_SP | VIS_TAB | VIS_NL. + + VIS_SAFE Only encode "unsafe" characters. Unsafe means control char- + acters which may cause common terminals to perform unexpected + functions. Currently this form allows space, tab, newline, + backspace, bell, and return - in addition to all graphic + characters - unencoded. + + There are three forms of encoding. All forms use the backslash character + `\' to introduce a special sequence; two backslashes are used to repre- + + sent a real backslash. These are the visual formats: + + (default) Use an `M' to represent meta characters (characters with the + 8th bit set), and use carat `^' to represent control charac- + ters see (iscntrl(3)). The following formats are used: + + \^C Represents the control character `C'. Spans characters + `\000' through `\037', and `\177' (as `\^?'). + + \M-C Represents character `C' with the 8th bit set. Spans + characters `\241' through `\376'. + + \M^C Represents control character `C' with the 8th bit set. + Spans characters `\200' through `\237', and `\377' (as + `\M^?'). + + \040 Represents ASCII space. + + \240 Represents Meta-space. + + VIS_CSTYLE Use C-style backslash sequences to represent standard non- + printable characters. The following sequences are used to + represent the indicated characters: + + \a - BEL (007) + \b - BS (010) + \f - NP (014) + \n - NL (012) + \r - CR (015) + \t - HT (011) + \v - VT (013) + \0 - NUL (000) + + When using this format, the nextc parameter is looked at to + determine if a NULL character can be encoded as `\0' instead + of `\000'. If _n_e_x_t_c is an octal digit, the latter representa- + tion is used to avoid ambiguity. + + VIS_OCTAL Use a three digit octal sequence. The form is `\ddd' where _d + represents an octal digit. + + There is one additional flag, VIS_NOSLASH, which inhibits the doubling of + backslashes and the backslash before the default format (that is, control + characters are represented by `^C' and meta characters as `M-C'). With + this flag set, the encoding is ambiguous and non-invertible. + +SSEEEE AALLSSOO + unvis(1), unvis(3) strunvis(3) + +HHIISSTTOORRYY + These functions first appeared in 4.4BSD. + + +4.4BSD June 9, 1993 2 diff --git a/usr/share/man/cat3/vprintf.0 b/usr/share/man/cat3/vprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/vprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/vscanf.0 b/usr/share/man/cat3/vscanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/vscanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/vsnprintf.0 b/usr/share/man/cat3/vsnprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/vsnprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/vsprintf.0 b/usr/share/man/cat3/vsprintf.0 new file mode 100644 index 0000000000..3290ca1ed3 --- /dev/null +++ b/usr/share/man/cat3/vsprintf.0 @@ -0,0 +1,256 @@ +PRINTF(3) BSD Programmer's Manual PRINTF(3) + +NNAAMMEE + pprriinnttff, ffpprriinnttff, sspprriinnttff, ssnnpprriinnttff, vvpprriinnttff, vvffpprriinnttff,, vvsspprriinnttff, + vvssnnpprriinnttff - formatted output conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + pprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + sspprriinnttff(_c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvpprriinnttff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffpprriinnttff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvsspprriinnttff(_c_h_a_r _*_s_t_r, _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssnnpprriinnttff(_c_h_a_r _*_s_t_r, _s_i_z_e___t _s_i_z_e, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The pprriinnttff() family of functions produces output according to a _f_o_r_m_a_t as + described below. PPrriinnttff() and vvpprriinnttff() write output to _s_t_d_o_u_t_, the + standard output stream; ffpprriinnttff() and vvffpprriinnttff() write output to the giv- + en output _s_t_r_e_a_m; sspprriinnttff(), ssnnpprriinnttff(), vvsspprriinnttff(), and vvssnnpprriinnttff() + write to the character string _s_t_r. These functions write the output under + the control of a _f_o_r_m_a_t string that specifies how subsequent arguments + (or arguments accessed via the variable-length argument facilities of + stdarg(3)) are converted for output. These functions return the number + of characters printed (not including the trailing `\0' used to end output + to strings). SSnnpprriinnttff() and vvssnnpprriinnttff() will write at most _s_i_z_e-1 of the + characters printed into the output string (the _s_i_z_e'th character then + gets the terminating `\0'); if the return value is greater than or equal + to the _s_i_z_e argument, the string was too short and some of the printed + characters were discarded. SSpprriinnttff() and vvsspprriinnttff() effectively assume + an infinite _s_i_z_e. + + The format string is composed of zero or more directives: ordinary char- + acters (not %%), which are copied unchanged to the output stream; and con- + version specifications, each of which results in fetching zero or more + subsequent arguments. Each conversion specification is introduced by the + character %%. The arguments must correspond properly (after type promo- + tion) with the conversion specifier. After the %%, the following appear + in sequence: + + ++oo Zero or more of the following flags: + + -- A ## character specifying that the value should be converted to an + ``alternate form''. For cc, dd, ii, nn, pp, ss, and uu, conversions, + this option has no effect. For oo conversions, the precision of + the number is increased to force the first character of the out- + put string to a zero (except if a zero value is printed with an + explicit precision of zero). For xx and XX conversions, a non-zero + result has the string `0x' (or `0X' for XX conversions) prepended + to it. For ee, EE, ff, gg, and GG, conversions, the result will al- + ways contain a decimal point, even if no digits follow it (nor- + mally, a decimal point appears in the results of those conver- + sions only if a digit follows). For gg and GG conversions, trail- + ing zeros are not removed from the result as they would otherwise + be. + + -- A zero `00' character specifying zero padding. For all conver- + sions except nn, the converted value is padded on the left with + zeros rather than blanks. If a precision is given with a numeric + conversion (Mc d, ii, oo, uu, ii, xx, and XX), the `00' flag is ignored. + + -- A negative field width flag `--' indicates the converted value is + to be left adjusted on the field boundary. Except for nn conver- + sions, the converted value is padded on the right with blanks, + rather than on the left with blanks or zeros. A `--' overrides a + `00' if both are given. + + -- A space, specifying that a blank should be left before a positive + number produced by a signed conversion (dd, ee, EE, ff, gg, GG, or ii). + + -- A `++' character specifying that a sign always be placed before a + number produced by a signed conversion. A `++' overrides a space + if both are used. + + ++oo An optional decimal digit string 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) to fill out the field width. + + ++oo An optional precision, in the form of a period `..' followed by an op- + tional digit string. If the digit string is omitted, the precision + is taken as zero. This gives the minimum number of digits to appear + for dd, ii, oo, uu, xx, and XX conversions, the number of digits to appear + after the decimal-point for ee, EE, and ff conversions, the maximum num- + ber of significant digits for gg and GG conversions, or the maximum + number of characters to be printed from a string for ss conversions. + + ++oo The optional character hh, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _s_h_o_r_t _i_n_t or _u_n_s_i_g_n_e_d _s_h_o_r_t _i_n_t ar- + gument, or that a following nn conversion corresponds to a pointer to + a _s_h_o_r_t _i_n_t argument. + + ++oo The optional character ll (ell) specifying that a following dd, ii, oo, + uu, xx, or XX conversion applies to a pointer to a _l_o_n_g _i_n_t or _u_n_s_i_g_n_e_d + _l_o_n_g _i_n_t argument, or that a following nn conversion corresponds to a + pointer to a _l_o_n_g _i_n_t argument. + + ++oo The optional character qq, specifying that a following dd, ii, oo, uu, xx, + or XX conversion corresponds to a _q_u_a_d _i_n_t or _u_n_s_i_g_n_e_d _q_u_a_d _i_n_t argu- + ment, or that a following nn conversion corresponds to a pointer to a + _q_u_a_d _i_n_t argument. + + ++oo The character LL specifying that a following ee, EE, ff, gg, or GG conver- + sion corresponds to a _l_o_n_g _d_o_u_b_l_e argument (but note that long double + values are not currently supported by the VAX and Tahoe compilers). + + ++oo A character that specifies the type of conversion to be applied. + + A field width or precision, or both, may be indicated by an asterisk `*' + instead of a digit string. In this case, an _i_n_t argument supplies the + field width or precision. A negative field width is treated as a left + adjustment flag followed by a positive field width; a negative precision + is treated as though it were missing. + + The conversion specifiers and their meanings are: + + ddiioouuxxXX The _i_n_t (or appropriate variant) argument is converted to signed + decimal (dd and ii), unsigned octal (oo), unsigned decimal (uu), or + unsigned hexadecimal (xx and XX) notation. The letters aabbccddeeff are + used for xx conversions; the letters AABBCCDDEEFF are used for conver- + sions. 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. + + DDOOUU The _l_o_n_g _i_n_t argument is converted to signed decimal, unsigned + octal, or unsigned decimal, as if the format had been lldd, lloo, or + lluu respectively. These conversion characters are deprecated, and + will eventually disappear. + + eeEE The _d_o_u_b_l_e argument is rounded and converted in the style + [-]d..dddee+-dd where there is one digit before the decimal-point + character and the number of digits after it is equal to the pre- + cision; if the precision is missing, it is taken as 6; if the + precision is zero, no decimal-point character appears. An EE con- + version uses the letter EE (rather than ee) to introduce the expo- + nent. The exponent always contains at least two digits; if the + value is zero, the exponent is 00. + + ff The _d_o_u_b_l_e argument is rounded and converted to decimal notation + in the style [-]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. + + gg The _d_o_u_b_l_e argument is converted in style ff or ee (or EE for GG con- + versions). 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 ee 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. + + cc The _i_n_t argument is converted to an _u_n_s_i_g_n_e_d _c_h_a_r, and the re- + sulting character is written. + + ss The ``_c_h_a_r _*'' argument is expected to be a pointer to an array + of character type (pointer to a string). Characters from the ar- + ray are written up to (but not including) a terminating NUL char- + acter; if a precision is specified, no more than the number spec- + ified are written. If a precision is given, no null character + need be present; if the precision is not specified, or is greater + than the size of the array, the array must contain a terminating + NUL character. + + pp The ``_v_o_i_d _*'' pointer argument is printed in hexadecimal (as if + by `%#x' or `%#lx'). + + nn The number of characters written so far is stored into the inte- + ger indicated by the ``_i_n_t _*'' (or variant) pointer argument. No + argument is converted. + + %% A `%' is written. No argument is converted. The complete conver- + sion specification is `%%'. + + + In no case does a non-existent 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. + +EEXXAAMMPPLLEESS + To print a date and time in the form `Sunday, July 3, 10:02', where + _w_e_e_k_d_a_y and _m_o_n_t_h are pointers to strings: + + #include + fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", + weekday, month, day, hour, min); + + To print pi to five decimal places: + + #include + #include + fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0)); + + To allocate a 128 byte string and print into it: + + #include + #include + #include + char *newfmt(const char *fmt, ...) + { + char *p; + va_list ap; + if ((p = malloc(128)) == NULL) + return (NULL); + va_start(ap, fmt); + (void) vsnprintf(p, 128, fmt, ap); + va_end(ap); + return (p); + } + +SSEEEE AALLSSOO + printf(1), scanf(3) + +SSTTAANNDDAARRDDSS + The ffpprriinnttff(), pprriinnttff(), sspprriinnttff(), vvpprriinnttff(), vvffpprriinnttff(), and vvsspprriinnttff() + functions conform to ANSI C X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions ssnnpprriinnttff() and vvssnnpprriinnttff() are new to this release. + +BBUUGGSS + The conversion formats %%DD, %%OO, and %%UU are not standard and are provided + only for backward compatibility. The effect of padding the %%pp format + with zeros (either by the `00' flag or by specifying a precision), and the + benign effect (i.e., none) of the `##' flag on %%nn and %%pp conversions, as + well as other nonsensical combinations such as %%LLdd, are not standard; + such combinations should be avoided. + + Because sspprriinnttff() and vvsspprriinnttff() assume an infinitely long string, + callers must be careful not to overflow the actual space; this is often + impossible to assure. For safety, programmers should use the ssnnpprriinnttff() + interface instead. Unfortunately, this interface is not portable. + +4.4BSD June 4, 1993 4 diff --git a/usr/share/man/cat3/vsscanf.0 b/usr/share/man/cat3/vsscanf.0 new file mode 100644 index 0000000000..6aeb2f5d99 --- /dev/null +++ b/usr/share/man/cat3/vsscanf.0 @@ -0,0 +1,196 @@ +SCANF(3) BSD Programmer's Manual SCANF(3) + +NNAAMMEE + ssccaannff, ffssccaannff, ssssccaannff, vvssccaannff, vvssssccaannff, vvffssccaannff - input format conversion + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _i_n_t + ssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + _i_n_t + ssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.); + + ##iinncclluuddee <> + + _i_n_t + vvssccaannff(_c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvssssccaannff(_c_o_n_s_t _c_h_a_r _*_s_t_r, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + + _i_n_t + vvffssccaannff(_F_I_L_E _*_s_t_r_e_a_m, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_p); + +DDEESSCCRRIIPPTTIIOONN + The ssccaannff() family of functions scans input according to a _f_o_r_m_a_t as de- + scribed below. This format may contain _c_o_n_v_e_r_s_i_o_n _s_p_e_c_i_f_i_e_r_s; the re- + sults from such conversions, if any, are stored through the _p_o_i_n_t_e_r argu- + ments. The ssccaannff() function reads input from the standard input stream + _s_t_d_i_n, ffssccaannff() reads input from the stream pointer _s_t_r_e_a_m, and ssssccaannff() + reads its input from the character string pointed to by _s_t_r. The + vvffssccaannff() function is analogous to vfprintf(3) and reads input from the + stream pointer _s_t_r_e_a_m using a variable argument list of pointers (see + stdarg(3)). The vvssccaannff() function scans a variable argument list from + the standard input and the vvssssccaannff() function scans it from a string; + these are analogous to the vvpprriinnttff() and vvsspprriinnttff() functions respective- + ly. Each successive _p_o_i_n_t_e_r argument must correspond properly with each + successive conversion specifier (but see `suppression' below). All con- + versions are introduced by the %% (percent sign) character. The _f_o_r_m_a_t + string may also contain other characters. White space (such as blanks, + tabs, or newlines) in the _f_o_r_m_a_t string match any amount of white space, + including none, in the input. Everything else matches only itself. + Scanning stops when an input character does not match such a format char- + acter. Scanning also stops when an input conversion cannot be made (see + below). + +CCOONNVVEERRSSIIOONNSS + Following the %% character introducing a conversion there may be a number + of _f_l_a_g characters, as follows: + + ** Suppresses assignment. The conversion that follows occurs as + usual, but no pointer is used; the result of the conversion is + simply discarded. + + hh Indicates that the conversion will be one of ddiioouuxx or nn and the + next pointer is a pointer to a _s_h_o_r_t _i_n_t (rather than _i_n_t). + + ll Indicates either that the conversion will be one of ddiioouuxx or nn + and the next pointer is a pointer to a _l_o_n_g _i_n_t (rather than + _i_n_t), or that the conversion will be one of eeffgg and the next + + pointer is a pointer to _d_o_u_b_l_e (rather than _f_l_o_a_t). + + LL Indicates that the conversion will be eeffgg and the next pointer is + a pointer to _l_o_n_g _d_o_u_b_l_e. (This type is not implemented; the LL + flag is currently ignored.) + + In addition to these flags, there may be an optional maximum field width, + expressed as a decimal integer, between the %% and the conversion. If no + width is given, a default of `infinity' is used (with one exception, be- + low); otherwise at most this many characters are scanned in processing + the conversion. Before conversion begins, most conversions skip white + space; this white space is not counted against the field width. + + The following conversions are available: + + %% Matches a literal `%'. That is, `%%' in the format string matches + a single input `%' character. No conversion is done, and assign- + ment does not occur. + + dd Matches an optionally signed decimal integer; the next pointer must + be a pointer to _i_n_t. + + DD Equivalent to ld; this exists only for backwards compatibility. + + ii Matches an optionally signed integer; the next pointer must be a + pointer to _i_n_t. The integer is read in base 16 if it begins with + `0x' or `0X', in base 8 if it begins with `0', and in base 10 oth- + erwise. Only characters that correspond to the base are used. + + oo Matches an octal integer; the next pointer must be a pointer to + _u_n_s_i_g_n_e_d _i_n_t. + + OO Equivalent to lo; this exists for backwards compatibility. + + uu Matches an optionally signed decimal integer; the next pointer must + be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + xx Matches an optionally a signed hexadecimal integer; the next point- + er must be a pointer to _u_n_s_i_g_n_e_d _i_n_t. + + XX Equivalent to llxx; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + ff Matches an optionally signed floating-point number; the next point- + er must be a pointer to _f_l_o_a_t. + + ee Equivalent to ff. + + gg Equivalent to ff. + + EE Equivalent to llff; this violates the ANSI C X3.159-1989 (``ANSI C + ''), but is backwards compatible with previous UNIX systems. + + FF Equivalent to llff; this exists only for backwards compatibility. + + ss Matches a sequence of non-white-space characters; the next pointer + must be a pointer to _c_h_a_r, and the array must be large enough to + accept all the sequence and the terminating NUL character. The in- + put string stops at white space or at the maximum field width, + whichever occurs first. + + cc Matches a sequence of _w_i_d_t_h count characters (default 1); the next + pointer must be a pointer to _c_h_a_r, and there must be enough room + for all the characters (no terminating NUL is added). The usual + skip of leading white space is suppressed. To skip white space + + first, use an explicit space in the format. + + [[ Matches a nonempty sequence of characters from the specified set of + accepted characters; the next pointer must be a pointer to _c_h_a_r, + and there must be enough room for all the characters in the string, + plus a terminating NUL character. 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 [ character and a close bracket ] charac- + ter. The set _e_x_c_l_u_d_e_s those characters if the first character af- + ter the open bracket is a circumflex ^^. 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 -- is also special; when placed between two other charac- + ters, it adds all intervening characters to the set. To include a + hyphen, make it the last character before the final close bracket. + For instance, `[^]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. + + pp Matches a pointer value (as printed by `%p' in printf(3)); the + next pointer must be a pointer to _v_o_i_d. + + nn 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 _i_n_t. This is _n_o_t a conversion, although it can + be suppressed with the ** flag. + + For backwards compatibility, other conversion characters (except `\0') + are taken as if they were `%d' or, if uppercase, `%ld', and a `conver- + sion' of `%\0' causes an immediate return of EOF. The FF and XX conversions + will be changed in the future to conform to the ANSI C standard, after + which they will act like ff and xx respectively. + +RREETTUURRNN VVAALLUUEESS + These functions return the number of input items assigned, which can be + fewer than provided for, or even zero, in the event of a matching fail- + ure. Zero indicates that, while there was input available, no conver- + sions were assigned; typically this is due to an invalid input character, + such as an alphabetic character for a `%d' conversion. The value EOF is + returned if an input failure occurs before any conversion such as an end- + of-file occurs. If an error or end-of-file occurs after conversion has + begun, the number of conversions which were successfully completed is re- + turned. + +SSEEEE AALLSSOO + strtol(3), strtoul(3), strtod(3), getc(3), printf(3) + +SSTTAANNDDAARRDDSS + The functions ffssccaannff(), ssccaannff(), and ssssccaannff() conform to ANSI C + X3.159-1989 (``ANSI C ''). + +HHIISSTTOORRYY + The functions vvssccaannff(), vvssssccaannff() and vvffssccaannff() are new to this release. + +BBUUGGSS + The current situation with %%FF and %%XX conversions is unfortunate. + + All of the backwards compatibility formats will be removed in the future. + + Numerical strings are truncated to 512 characters; for example, %%ff and %%dd + are implicitly %%551122ff and %%551122dd. + +4.4BSD June 4, 1993 3 diff --git a/usr/share/man/cat3/vsyslog.0 b/usr/share/man/cat3/vsyslog.0 new file mode 100644 index 0000000000..cbcb3a15d5 --- /dev/null +++ b/usr/share/man/cat3/vsyslog.0 @@ -0,0 +1,150 @@ +SYSLOG(3) BSD Programmer's Manual SYSLOG(3) + +NNAAMMEE + ssyysslloogg, vvssyysslloogg, ooppeennlloogg, cclloosseelloogg, sseettllooggmmaasskk - control system log + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + ##iinncclluuddee <> + + _v_o_i_d + ssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _._._.); + + _v_o_i_d + vvssyysslloogg(_i_n_t _p_r_i_o_r_i_t_y, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + ooppeennlloogg(_c_o_n_s_t _c_h_a_r _*_i_d_e_n_t, _i_n_t _l_o_g_o_p_t, _i_n_t _f_a_c_i_l_i_t_y); + + _v_o_i_d + cclloosseelloogg(_v_o_i_d); + + _i_n_t + sseettllooggmmaasskk(_i_n_t _m_a_s_k_p_r_i); + +DDEESSCCRRIIPPTTIIOONN + The ssyysslloogg() function writes _m_e_s_s_a_g_e to the system message logger. The + message is then written to the system console, log files, logged-in + users, or forwarded to other machines as appropriate. (See syslogd(8).) + + The message is identical to a printf(3) format string, except that `%m' + is replaced by the current error message. (As denoted by the global vari- + able _e_r_r_n_o; see strerror(3).) A trailing newline is added if none is + present. + + The vvssyysslloogg() function is an alternate form in which the arguments have + already been captured using the variable-length argument facilities of + varargs(3). + + The message is tagged with _p_r_i_o_r_i_t_y. Priorities are encoded as a _f_a_c_i_l_i_t_y + and a _l_e_v_e_l. The facility describes the part of the system generating the + message. The level is selected from the following _o_r_d_e_r_e_d (high to low) + list: + + LOG_EMERG A panic condition. This is normally broadcast to all + users. + + LOG_ALERT A condition that should be corrected immediately, such as a + corrupted system database. + + LOG_CRIT Critical conditions, e.g., hard device errors. + + LOG_ERR Errors. + + LOG_WARNING Warning messages. + + LOG_NOTICE Conditions that are not error conditions, but should possi- + bly be handled specially. + + LOG_INFO Informational messages. + + LOG_DEBUG Messages that contain information normally of use only when + debugging a program. + + The ooppeennlloogg() function provides for more specialized processing of the + messages sent by ssyysslloogg() and vvssyysslloogg(). The parameter _i_d_e_n_t is a string + that will be prepended to every message. The _l_o_g_o_p_t argument is a bit + field specifying logging options, which is formed by OR'ing one or more + of the following values: + + LOG_CONS If ssyysslloogg() cannot pass the message to syslogd it will at- + tempt to write the message to the console + (``_/_d_e_v_/_c_o_n_s_o_l_e_.'') + + LOG_NDELAY Open the connection to syslogd immediately. Normally the + open is delayed until the first message is logged. Useful + for programs that need to manage the order in which file + descriptors are allocated. + + LOG_PERROR Write the message to standard error output as well to the + system log. + + LOG_PID Log the process id with each message: useful for identify- + ing instantiations of daemons. + + The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all + messages that do not have an explicit facility encoded: + + LOG_AUTH The authorization system: login(1), su(1), getty(8), + etc. + + LOG_AUTHPRIV The same as LOG_AUTH, but logged to a file readable only by + selected individuals. + + LOG_CRON The clock daemon. + + LOG_DAEMON System daemons, such as routed(8), that are not provided + for explicitly by other facilities. + + LOG_KERN Messages generated by the kernel. These cannot be generat- + ed by any user processes. + + LOG_LPR The line printer spooling system: lpr(1), lpc(8), lpd(8), + etc. + + LOG_MAIL The mail system. + + LOG_NEWS The network news system. + + LOG_SYSLOG Messages generated internally by syslogd(8). + + LOG_USER Messages generated by random user processes. This is the + default facility identifier if none is specified. + + LOG_UUCP The uucp system. + + LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through + LOG_LOCAL7. + + The cclloosseelloogg() function can be used to close the log file. + + The sseettllooggmmaasskk() function sets the log priority mask to _m_a_s_k_p_r_i and re- + turns the previous mask. Calls to ssyysslloogg() with a priority not set in + _m_a_s_k_p_r_i are rejected. The mask for an individual priority _p_r_i is calcu- + lated by the macro LLOOGG__MMAASSKK(_p_r_i); the mask for all priorities up to and + including _t_o_p_p_r_i is given by the macro LLOOGG__UUPPTTOO(_t_o_p_p_r_i);. The default al- + lows all priorities to be logged. + +RREETTUURRNN VVAALLUUEESS + The routines cclloosseelloogg(), ooppeennlloogg(), ssyysslloogg() and vvssyysslloogg() return no val- + ue. + + + The routine sseettllooggmmaasskk() always returns the previous log mask level. + +EEXXAAMMPPLLEESS + syslog(LOG_ALERT, "who: internal error 23"); + + openlog("ftpd", LOG_PID, LOG_DAEMON); + setlogmask(LOG_UPTO(LOG_ERR)); + syslog(LOG_INFO, "Connection from host %d", CallingHost); + + syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); + +SSEEEE AALLSSOO + logger(1), syslogd(8) + +HHIISSTTOORRYY + These functions appeared in 4.2BSD. + +4.2 Berkeley Distribution June 4, 1993 3 diff --git a/usr/share/man/cat3/vwarn.0 b/usr/share/man/cat3/vwarn.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/vwarn.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/vwarnx.0 b/usr/share/man/cat3/vwarnx.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/vwarnx.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/warn.0 b/usr/share/man/cat3/warn.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/warn.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/warnx.0 b/usr/share/man/cat3/warnx.0 new file mode 100644 index 0000000000..2f0d58f80a --- /dev/null +++ b/usr/share/man/cat3/warnx.0 @@ -0,0 +1,74 @@ +ERR(3) BSD Programmer's Manual ERR(3) + +NNAAMMEE + eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes- + sages + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _v_o_i_d + eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + + _v_o_i_d + wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.); + + _v_o_i_d + vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s); + +DDEESSCCRRIIPPTTIIOONN + The eerrrr() and wwaarrnn() family of functions display a formatted error mes- + sage 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 _f_m_t + argument is not NULL, the formatted error message, a colon character, and + a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and + vvwwaarrnn() functions, the error message string affiliated with the current + value of the global variable _e_r_r_n_o is output. In all cases, the output + is followed by a newline character. + + The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit + with the value of the argument _e_v_a_l. + +EEXXAAMMPPLLEESS + Display the current errno information string and exit: + + if ((p = malloc(size)) == NULL) + err(1, NULL); + if ((fd = open(file_name, O_RDONLY, 0)) == -1) + err(1, "%s", file_name); + + Display an error message and exit: + + if (tm.tm_hour < START_TIME) + errx(1, "too early, wait until %s", start_time_string); + + Warn of an error: + + 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); + +SSEEEE AALLSSOO + strerror(3) + +HHIISSTTOORRYY + The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD. + +4th Berkeley Distribution June 9, 1993 2 diff --git a/usr/share/man/cat3/zopen.0 b/usr/share/man/cat3/zopen.0 new file mode 100644 index 0000000000..2fd17e7a49 --- /dev/null +++ b/usr/share/man/cat3/zopen.0 @@ -0,0 +1,56 @@ +ZOPEN(3) BSD Programmer's Manual ZOPEN(3) + +NNAAMMEE + zzooppeenn - compressed stream open function + +SSYYNNOOPPSSIISS + ##iinncclluuddee <> + + _F_I_L_E _* + zzooppeenn(_c_o_n_s_t _c_h_a_r _*_p_a_t_h, _c_o_n_s_t _c_h_a_r _*_m_o_d_e, _i_n_t _b_i_t_s); + +DDEESSCCRRIIPPTTIIOONN + The zzooppeenn() function opens the compressed file whose name is the string + pointed to by _p_a_t_h and associates a stream with it. + + The argument _m_o_d_e points to one of the following one-character strings: + + ``r'' Open compressed file for reading. The stream is positioned at + the beginning of the file. + + ``w'' Truncate file to zero length or create compressed file for writ- + ing. The stream is positioned at the beginning of the file. + + Any created files will have mode "S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | + S_IROTH | S_IWOTH" (0666), as modified by the process' umask value (see + umask(2)). + + Files may only be read or written. Seek operations are not allowed. + + The _b_i_t_s argument, if non-zero, is set to the bits code limit. If zero, + the default is 16. See ccoommpprreessss(_1) for more information. + +RREETTUURRNN VVAALLUUEESS + Upon successful completion zzooppeenn() returns a FILE pointer. Otherwise, + NULL is returned and the global variable _e_r_r_n_o is set to indicate the er- + ror. + +EERRRROORRSS + [EINVAL] The _m_o_d_e or _b_i_t_s arguments specified to zzooppeenn() were invalid. + + [EFTYPE] The compressed file starts with an invalid header, or the com- + pressed file is compressed with more bits than can be handled. + + The zzooppeenn() function may also fail and set _e_r_r_n_o for any of the errors + specified for the routines fopen(3) or funopen(3). + +SSEEEE AALLSSOO + compress(1), fopen(3), funopen(3) + +HHIISSTTOORRYY + The zzooppeenn function first appeared in 4.4BSD. + +BBUUGGSS + The zzooppeenn() function may not be portable to systems other than BSD. + +4.4BSD June 9, 1993 1 diff --git a/usr/share/man/cat4/euc.0 b/usr/share/man/cat4/euc.0 new file mode 100644 index 0000000000..c76ba5a5b6 --- /dev/null +++ b/usr/share/man/cat4/euc.0 @@ -0,0 +1,158 @@ +EUC(4) BSD Programmer's Manual EUC(4) + +NNAAMMEE + EEUUCC - EUC encoding of runes + +SSYYNNOOPPSSIISS + EENNCCOODDIINNGG ""EEUUCC"" + VVAARRIIAABBLLEE _l_e_n_1 _m_a_s_k_1 _l_e_n_2 _m_a_s_k_2 _l_e_n_3 _m_a_s_k_3 _l_e_n_4 _m_a_s_k_4 _m_a_s_k + +DDEESSCCRRIIPPTTIIOONN + The EEUUCC encoding is provided for compatibility with UNIX based systems. + See mklocale(1) for a complete description of the LC_CTYPE source file + format. + + EEUUCC implements a system of 4 multibyte codesets. A multibyte character + in the first codeset consists of _l_e_n_1 bytes starting with a byte in the + range of 0x00 to 0x7f. To allow use of ASCII, _l_e_n_1 is always 1. A + multibyte character in the second codeset consists of _l_e_n_2 bytes starting + with a byte in the range of 0x80-0xff excluding 0x8e and 0x8f. A multi- + byte character in the third codeset consists of _l_e_n_3 bytes starting with + the byte 0x8e. A multibyte character in the fourth codeset consists of + _l_e_n_4 bytes starting with the byte 0x8f. + + The rune_t encoding of EEUUCC multibyte characters is dependent on the _l_e_n + and _m_a_s_k arguments. First, the bytes are moved into a rune_t as follows: + + byte0 << ((_l_e_nN-1) * 8) | byte1 << ((_l_e_nN-2) * 8) | ... | byte_l_e_nN-1 + + The result is then ANDed with _~_m_a_s_k and ORed with _m_a_s_k_N_. _C_o_d_e_s_e_t_s _2 _a_n_d _3 + _a_r_e _s_p_e_c_i_a_l _i_n _t_h_a_t _t_h_e _l_e_a_d_i_n_g _b_y_t_e _(_0_x_8_e _o_r _0_x_8_f_) _i_s _f_i_r_s_t _r_e_m_o_v_e_d _a_n_d + _t_h_e _l_e_n_N _a_r_g_u_m_e_n_t _i_s _r_e_d_u_c_e_d _b_y _1_. + + _F_o_r _e_x_a_m_p_l_e_, _t_h_e _J_a_p_a_n_e_s_e _l_o_c_a_l_e _h_a_s _t_h_e _f_o_l_l_o_w_i_n_g VARIABLE _l_i_n_e_: + + _V_A_R_I_A_B_L_E _1 _0_x_0_0_0_0 _2 _0_x_8_0_8_0 _2 _0_x_0_0_8_0 _3 _0_x_8_0_0_0 _0_x_8_0_8_0 + + _C_o_d_e_s_e_t _1 _c_o_n_s_i_s_t_s _o_f _t_h_e _v_a_l_u_e_s _0_x_0_0_0_0 _- _0_x_0_0_7_f_. + + _C_o_d_e_s_e_t _2 _c_o_n_s_i_s_t_s _o_f _t_h_e _v_a_l_u_e_s _w_h_o _h_a_v_e _t_h_e _b_i_t_s _0_x_8_0_8_0 _s_e_t_. + + _C_o_d_e_s_e_t _3 _c_o_n_s_i_s_t_s _o_f _t_h_e _v_a_l_u_e_s _0_x_0_0_8_0 _- _0_x_0_0_f_f_. + + _C_o_d_e_s_e_t _4 _c_o_n_s_i_s_t_s _o_f _t_h_e _v_a_l_u_e_s _0_x_8_0_0_0 _- _0_x_f_f_7_f _e_x_c_l_u_d_i_n_g _t_h_e _v_a_l_u_e_s + _w_h_i_c_h _h_a_v_e _t_h_e _0_x_0_0_8_0 _b_i_t _s_e_t_. + + _N_o_t_i_c_e _t_h_a_t _t_h_e _g_l_o_b_a_l _m_a_s_k _i_s _s_e_t _t_o _0_x_8_0_8_0_, _t_h_i_s _i_m_p_l_i_e_s _t_h_a_t _f_r_o_m + _t_h_o_s_e _2 _b_i_t_s _t_h_e _c_o_d_e_s_e_t _c_a_n _b_e _d_e_t_e_r_m_i_n_e_d_. + +EEXXAAMMPPLLEE -- JJaappaanneessee LLooccaallee + _T_h_i_s _i_s _a _c_o_m_p_l_e_t_e _e_x_a_m_p_l_e _o_f _a_n LC_CTYPE _s_o_u_r_c_e _f_i_l_e _f_o_r _t_h_e _J_a_p_a_n_e_s_e + _l_o_c_a_l_e + + _/_* + _* _J_a_p_a_n_e_s_e _L_O_C_A_L_E___C_T_Y_P_E _d_e_f_i_n_i_t_i_o_n_s _u_s_i_n_g _E_U_C _o_f _J_I_S _c_h_a_r_a_c_t_e_r _s_e_t_s + _*_/ + + _E_N_C_O_D_I_N_G _"_E_U_C_" + + _/_* _J_I_S _J_I_S _J_I_S _*_/ + _/_* _X_2_0_1 _X_2_0_8 _X_2_0_1 _*_/ + _/_* _0_0_-_7_f _8_4_-_f_e _*_/ + + _V_A_R_I_A_B_L_E _1 _0_x_0_0_0_0 _2 _0_x_8_0_8_0 _2 _0_x_0_0_8_0 _3 _0_x_8_0_0_0 _0_x_8_0_8_0 + + _/_* + _* _C_o_d_e _S_e_t _1 + _*_/ + _A_L_P_H_A _'_A_' _- _'_Z_' _'_a_' _- _'_z_' + _C_O_N_T_R_O_L _0_x_0_0 _- _0_x_1_f _0_x_7_f + _D_I_G_I_T _'_0_' _- _'_9_' + _G_R_A_P_H _0_x_2_1 _- _0_x_7_e + _L_O_W_E_R _'_a_' _- _'_z_' + _P_U_N_C_T _0_x_2_1 _- _0_x_2_f _0_x_3_a _- _0_x_4_0 _0_x_5_b _- _0_x_6_0 _0_x_7_b _- _0_x_7_e + _S_P_A_C_E _0_x_0_9 _- _0_x_0_d _0_x_2_0 + _U_P_P_E_R _'_A_' _- _'_Z_' + _X_D_I_G_I_T _'_a_' _- _'_f_' _'_A_' _- _'_F_' + _B_L_A_N_K _' _' _'_' + _P_R_I_N_T _0_x_2_0 _- _0_x_7_e + + _M_A_P_L_O_W_E_R _< _'_A_' _- _'_Z_' _: _'_a_' _> _< _'_a_' _- _'_z_' _: _'_a_' _> + _M_A_P_U_P_P_E_R _< _'_A_' _- _'_Z_' _: _'_A_' _> _< _'_a_' _- _'_z_' _: _'_A_' _> + _T_O_D_I_G_I_T _< _'_0_' _- _'_9_' _: _0 _> + _T_O_D_I_G_I_T _< _'_A_' _- _'_F_' _: _1_0 _> _< _'_a_' _- _'_f_' _: _1_0 _> + + _/_* + _* _C_o_d_e _S_e_t _2 + _*_/ + + _S_P_A_C_E _0_x_a_1_a_1 + _P_H_O_N_O_G_R_A_M _0_x_a_1_b_c + _S_P_E_C_I_A_L _0_x_a_1_a_2 _- _0_x_a_1_f_e + _P_U_N_C_T _0_x_a_1_a_2 _- _0_x_a_1_f_8 _/_* _A _f_e_w _t_o_o _m_a_n_y _i_n _h_e_r_e_._._. _*_/ + + _S_P_E_C_I_A_L _0_x_a_2_a_1 _- _0_x_a_2_a_e _0_x_a_2_b_a _- _0_x_a_2_c_1 _0_x_a_2_c_a _- _0_x_a_2_d_0 _0_x_a_2_d_c _- _0_x_a_2_e_a + _S_P_E_C_I_A_L _0_x_a_2_f_2 _- _0_x_a_2_f_9 _0_x_a_2_f_e + + _D_I_G_I_T _0_x_a_3_b_0 _- _0_x_a_3_b_9 + _U_P_P_E_R _0_x_a_3_c_1 _- _0_x_a_3_d_a _/_* _R_o_m_a_j_i _*_/ + _L_O_W_E_R _0_x_a_3_e_1 _- _0_x_a_3_f_a _/_* _R_o_m_a_j_i _*_/ + _M_A_P_L_O_W_E_R _< _0_x_a_3_c_1 _- _0_x_a_3_d_a _: _0_x_a_3_e_1 _> _/_* _E_n_g_l_i_s_h _*_/ + _M_A_P_L_O_W_E_R _< _0_x_a_3_e_1 _- _0_x_a_3_f_a _: _0_x_a_3_e_1 _> _/_* _E_n_g_l_i_s_h _*_/ + _M_A_P_U_P_P_E_R _< _0_x_a_3_c_1 _- _0_x_a_3_d_a _: _0_x_a_3_c_1 _> + _M_A_P_U_P_P_E_R _< _0_x_a_3_e_1 _- _0_x_a_3_f_a _: _0_x_a_3_c_1 _> + + _X_D_I_G_I_T _0_x_a_3_c_1 _- _0_x_a_3_c_6 _0_x_a_3_e_1 _- _0_x_a_3_e_6 + + _T_O_D_I_G_I_T _< _0_x_a_3_b_0 _- _0_x_a_3_b_9 _: _0 _> + _T_O_D_I_G_I_T _< _0_x_a_3_c_1 _- _0_x_a_3_c_6 _: _1_0 _> _< _0_x_a_3_e_1 _- _0_x_a_3_e_6 _: _1_0 _> + + _P_H_O_N_O_G_R_A_M _0_x_a_4_a_1 _- _0_x_a_4_f_3 + _P_H_O_N_O_G_R_A_M _0_x_a_5_a_1 _- _0_x_a_5_f_6 + + _U_P_P_E_R _0_x_a_6_a_1 _- _0_x_a_6_b_8 _/_* _G_r_e_e_k _*_/ + _L_O_W_E_R _0_x_a_6_c_1 _- _0_x_a_6_d_8 _/_* _G_r_e_e_k _*_/ + _M_A_P_L_O_W_E_R _< _0_x_a_6_a_1 _- _0_x_a_6_b_8 _: _0_x_a_6_c_1 _> _< _0_x_a_6_c_1 _- _0_x_a_6_d_8 _: _0_x_a_6_c_1 _> + _M_A_P_U_P_P_E_R _< _0_x_a_6_a_1 _- _0_x_a_6_b_8 _: _0_x_a_6_a_1 _> _< _0_x_a_6_c_1 _- _0_x_a_6_d_8 _: _0_x_a_6_a_1 _> + + _U_P_P_E_R _0_x_a_7_a_1 _- _0_x_a_7_c_1 _/_* _C_y_r_i_l_l_i_c _*_/ + _L_O_W_E_R _0_x_a_7_d_1 _- _0_x_a_7_f_1 _/_* _C_y_r_i_l_l_i_c _*_/ + _M_A_P_L_O_W_E_R _< _0_x_a_7_a_1 _- _0_x_a_7_c_1 _: _0_x_a_7_d_1 _> _< _0_x_a_7_d_1 _- _0_x_a_7_f_1 _: _0_x_a_7_d_1 _> + _M_A_P_U_P_P_E_R _< _0_x_a_7_a_1 _- _0_x_a_7_c_1 _: _0_x_a_7_a_1 _> _< _0_x_a_7_d_1 _- _0_x_a_7_f_1 _: _0_x_a_7_a_1 _> + + _S_P_E_C_I_A_L _0_x_a_8_a_1 _- _0_x_a_8_c_0 + + _I_D_E_O_G_R_A_M _0_x_b_0_a_1 _- _0_x_b_0_f_e _0_x_b_1_a_1 _- _0_x_b_1_f_e _0_x_b_2_a_1 _- _0_x_b_2_f_e + _I_D_E_O_G_R_A_M _0_x_b_3_a_1 _- _0_x_b_3_f_e _0_x_b_4_a_1 _- _0_x_b_4_f_e _0_x_b_5_a_1 _- _0_x_b_5_f_e + _I_D_E_O_G_R_A_M _0_x_b_6_a_1 _- _0_x_b_6_f_e _0_x_b_7_a_1 _- _0_x_b_7_f_e _0_x_b_8_a_1 _- _0_x_b_8_f_e + _I_D_E_O_G_R_A_M _0_x_b_9_a_1 _- _0_x_b_9_f_e _0_x_b_a_a_1 _- _0_x_b_a_f_e _0_x_b_b_a_1 _- _0_x_b_b_f_e + _I_D_E_O_G_R_A_M _0_x_b_c_a_1 _- _0_x_b_c_f_e _0_x_b_d_a_1 _- _0_x_b_d_f_e _0_x_b_e_a_1 _- _0_x_b_e_f_e + _I_D_E_O_G_R_A_M _0_x_b_f_a_1 _- _0_x_b_f_f_e _0_x_c_0_a_1 _- _0_x_c_0_f_e _0_x_c_1_a_1 _- _0_x_c_1_f_e + _I_D_E_O_G_R_A_M _0_x_c_2_a_1 _- _0_x_c_2_f_e _0_x_c_3_a_1 _- _0_x_c_3_f_e _0_x_c_4_a_1 _- _0_x_c_4_f_e + _I_D_E_O_G_R_A_M _0_x_c_5_a_1 _- _0_x_c_5_f_e _0_x_c_6_a_1 _- _0_x_c_6_f_e _0_x_c_7_a_1 _- _0_x_c_7_f_e + _I_D_E_O_G_R_A_M _0_x_c_8_a_1 _- _0_x_c_8_f_e _0_x_c_9_a_1 _- _0_x_c_9_f_e _0_x_c_a_a_1 _- _0_x_c_a_f_e + _I_D_E_O_G_R_A_M _0_x_c_b_a_1 _- _0_x_c_b_f_e _0_x_c_c_a_1 _- _0_x_c_c_f_e _0_x_c_d_a_1 _- _0_x_c_d_f_e + _I_D_E_O_G_R_A_M _0_x_c_e_a_1 _- _0_x_c_e_f_e _0_x_c_f_a_1 _- _0_x_c_f_d_3 _0_x_d_0_a_1 _- _0_x_d_0_f_e + _I_D_E_O_G_R_A_M _0_x_d_1_a_1 _- _0_x_d_1_f_e _0_x_d_2_a_1 _- _0_x_d_2_f_e _0_x_d_3_a_1 _- _0_x_d_3_f_e + _I_D_E_O_G_R_A_M _0_x_d_4_a_1 _- _0_x_d_4_f_e _0_x_d_5_a_1 _- _0_x_d_5_f_e _0_x_d_6_a_1 _- _0_x_d_6_f_e + _I_D_E_O_G_R_A_M _0_x_d_7_a_1 _- _0_x_d_7_f_e _0_x_d_8_a_1 _- _0_x_d_8_f_e _0_x_d_9_a_1 _- _0_x_d_9_f_e + _I_D_E_O_G_R_A_M _0_x_d_a_a_1 _- _0_x_d_a_f_e _0_x_d_b_a_1 _- _0_x_d_b_f_e _0_x_d_c_a_1 _- _0_x_d_c_f_e + _I_D_E_O_G_R_A_M _0_x_d_d_a_1 _- _0_x_d_d_f_e _0_x_d_e_a_1 _- _0_x_d_e_f_e _0_x_d_f_a_1 _- _0_x_d_f_f_e + _I_D_E_O_G_R_A_M _0_x_e_0_a_1 _- _0_x_e_0_f_e _0_x_e_1_a_1 _- _0_x_e_1_f_e _0_x_e_2_a_1 _- _0_x_e_2_f_e + _I_D_E_O_G_R_A_M _0_x_e_3_a_1 _- _0_x_e_3_f_e _0_x_e_4_a_1 _- _0_x_e_4_f_e _0_x_e_5_a_1 _- _0_x_e_5_f_e + _I_D_E_O_G_R_A_M _0_x_e_6_a_1 _- _0_x_e_6_f_e _0_x_e_7_a_1 _- _0_x_e_7_f_e _0_x_e_8_a_1 _- _0_x_e_8_f_e + _I_D_E_O_G_R_A_M _0_x_e_9_a_1 _- _0_x_e_9_f_e _0_x_e_a_a_1 _- _0_x_e_a_f_e _0_x_e_b_a_1 _- _0_x_e_b_f_e + _I_D_E_O_G_R_A_M _0_x_e_c_a_1 _- _0_x_e_c_f_e _0_x_e_d_a_1 _- _0_x_e_d_f_e _0_x_e_e_a_1 _- _0_x_e_e_f_e + _I_D_E_O_G_R_A_M _0_x_e_f_a_1 _- _0_x_e_f_f_e _0_x_f_0_a_1 _- _0_x_f_0_f_e _0_x_f_1_a_1 _- _0_x_f_1_f_e + _I_D_E_O_G_R_A_M _0_x_f_2_a_1 _- _0_x_f_2_f_e _0_x_f_3_a_1 _- _0_x_f_3_f_e _0_x_f_4_a_1 _- _0_x_f_4_a_4 + _/_* + _* _T_h_i_s _i_s _f_o_r _C_o_d_e _S_e_t _3_, _h_a_l_f_-_w_i_d_t_h _k_a_n_a + _*_/ + _S_P_E_C_I_A_L _0_x_a_1 _- _0_x_d_f + _P_H_O_N_O_G_R_A_M _0_x_a_1 _- _0_x_d_f + _C_O_N_T_R_O_L _0_x_8_4 _- _0_x_9_7 _0_x_9_b _- _0_x_9_f _0_x_e_0 _- _0_x_f_e + +SSEEEE AALLSSOO + mklocale_(_1_)_, setlocale_(_3_) + +4.4BSD June 4, 1993 _3 diff --git a/usr/share/man/cat4/utf2.0 b/usr/share/man/cat4/utf2.0 new file mode 100644 index 0000000000..e32a63f95f --- /dev/null +++ b/usr/share/man/cat4/utf2.0 @@ -0,0 +1,46 @@ +UTF2(4) BSD Programmer's Manual UTF2(4) + +NNAAMMEE + UUTTFF22 - Universal character set Transformation Format encoding of runes + +SSYYNNOOPPSSIISS + EENNCCOODDIINNGG ""UUTTFF22"" + +DDEESSCCRRIIPPTTIIOONN + The UUTTFF22 encoding is based on a proposed X-Open multibyte FSS-UCS-TF + (File System Safe Universal Character Set Transformation Format) encoding + as used in PPllaann 99 ffrroomm BBeellll LLaabbss.. Although it is capable of representing + more than 16 bits, the current implementation is limited to 16 bits as + defined by the Unicode Standard. + + UUTTFF22 representation is backwards compatible with ASCII, so 0x00-0x7f re- + fer to the ASCII character set. The multibyte encoding of runes between + 0x0080 and 0xffff consist entirely of bytes whose high order bit is set. + The actual encoding is represented by the following table: + + [0x0000 - 0x007f] [00000000.0bbbbbbb] -> 0bbbbbbb + [0x0080 - 0x03ff] [00000bbb.bbbbbbbb] -> 110bbbbb, 10bbbbbb + [0x0400 - 0xffff] [bbbbbbbb.bbbbbbbb] -> 1110bbbb, 10bbbbbb, 10bbbbbb + + If more than a single representation of a value exists (for example, + 0x00; 0xC0 0x80; 0xE0 0x80 0x80) the shortest representation is always + used (but the longer ones will be correctly decoded). + + The final three encodings provided by X-Open: + + [00000000.000bbbbb.bbbbbbbb.bbbbbbbb] -> + 11110bbb, 10bbbbbb, 10bbbbbb, 10bbbbbb + + [000000bb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 111110bb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb + + [0bbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb] -> + 1111110b, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb + + which provides for the entire proposed ISO-10646 31 bit standard are cur- + rently not implemented. + +SSEEEE AALLSSOO + mklocale(1), setlocale(3) + +4.4BSD June 4, 1993 1 diff --git a/usr/share/man/cat7/re_format.0 b/usr/share/man/cat7/re_format.0 new file mode 100644 index 0000000000..a95a3e1038 --- /dev/null +++ b/usr/share/man/cat7/re_format.0 @@ -0,0 +1,330 @@ + + + +RE_FORMAT(7) BSD Reference Manual RE_FORMAT(7) + + +NNAAMMEE + re_format - POSIX 1003.2 regular expressions + +DDEESSCCRRIIPPTTIIOONN + Regular expressions (``RE''s), as defined in POSIX 1003.2, + come in two forms: modern REs (roughly those of _e_g_r_e_p; + 1003.2 calls these ``extended'' REs) and obsolete REs + (roughly those of _e_d; 1003.2 ``basic'' REs). Obsolete REs + mostly exist for backward compatibility in some old pro- + grams; they will be discussed at the end. 1003.2 leaves + some aspects of RE syntax and semantics open; `|-' marks + decisions on these aspects that may not be fully portable + to other 1003.2 implementations. + + A (modern) RE is one|- or more non-empty|- _b_r_a_n_c_h_e_s, sepa- + rated by `|'. It matches anything that matches one of the + branches. + + A branch is one|- or more _p_i_e_c_e_s, concatenated. It matches + a match for the first, followed by a match for the second, + etc. + + A piece is an _a_t_o_m possibly followed by a single|- `*', + `+', `?', or _b_o_u_n_d. An atom followed by `*' matches a + sequence of 0 or more matches of the atom. An atom fol- + lowed by `+' matches a sequence of 1 or more matches of + the atom. An atom followed by `?' matches a sequence of 0 + or 1 matches of the atom. + + A _b_o_u_n_d is `{' followed by an unsigned decimal integer, + possibly followed by `,' possibly followed by another + unsigned decimal integer, always followed by `}'. The + integers must lie between 0 and RE_DUP_MAX (255|-) inclu- + sive, and if there are two of them, the first may not + exceed the second. An atom followed by a bound containing + one integer _i and no comma matches a sequence of exactly _i + matches of the atom. An atom followed by a bound contain- + ing one integer _i and a comma matches a sequence of _i or + more matches of the atom. An atom followed by a bound + containing two integers _i and _j matches a sequence of _i + through _j (inclusive) matches of the atom. + + An atom is a regular expression enclosed in `()' (matching + a match for the regular expression), an empty set of `()' + (matching the null string)|-, a _b_r_a_c_k_e_t _e_x_p_r_e_s_s_i_o_n (see + below), `.' (matching any single character), `^' (match- + ing the null string at the beginning of a line), `$' + (matching the null string at the end of a line), a `\' + followed by one of the characters `^.[$()|*+?{\' (matching + that character taken as an ordinary character), a `\' fol- + lowed by any other character|- (matching that character + + + +4.4BSD June 4, 1993 1 + + + + + + + + +RE_FORMAT(7) BSD Reference Manual RE_FORMAT(7) + + + taken as an ordinary character, as if the `\' had not been + present|-), or a single character with no other signifi- + cance (matching that character). A `{' followed by a + character other than a digit is an ordinary character, not + the beginning of a bound|-. It is illegal to end an RE + with `\'. + + A _b_r_a_c_k_e_t _e_x_p_r_e_s_s_i_o_n is a list of characters enclosed in + `[]'. It normally matches any single character from the + list (but see below). If the list begins with `^', it + matches any single character (but see below) _n_o_t from the + rest of the list. If two characters in the list are sepa- + rated by `-', this is shorthand for the full _r_a_n_g_e of + characters between those two (inclusive) in the collating + sequence, e.g. `[0-9]' in ASCII matches any decimal digit. + It is illegal|- for two ranges to share an endpoint, e.g. + `a-c-e'. Ranges are very collating-sequence-dependent, + and portable programs should avoid relying on them. + + To include a literal `]' in the list, make it the first + character (following a possible `^'). To include a lit- + eral `-', make it the first or last character, or the sec- + ond endpoint of a range. To use a literal `-' as the + first endpoint of a range, enclose it in `[.' and `.]' to + make it a collating element (see below). With the excep- + tion of these and some combinations using `[' (see next + paragraphs), all other special characters, including `\', + lose their special significance within a bracket expres- + sion. + + Within a bracket expression, a collating element (a char- + acter, a multi-character sequence that collates as if it + were a single character, or a collating-sequence name for + either) enclosed in `[.' and `.]' 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 multi-character collating + element can thus match more than one character, e.g. if + the collating sequence includes a `ch' collating element, + then the RE `[[.ch.]]*c' matches the first five characters + of `chchcc'. + + Within a bracket expression, a collating element enclosed + in `[=' and `=]' is an equivalence class, standing for the + sequences of characters of all collating elements equiva- + lent to that one, including itself. (If there are no + other equivalent collating elements, the treatment is as + if the enclosing delimiters were `[.' and `.]'.) For + example, if o and o^ are the members of an equivalence + class, then `[[=o=]]', `[[=o^=]]', and `[oo^]' are all syn- + onymous. An equivalence class may not|- be an endpoint of + + + +4.4BSD June 4, 1993 2 + + + + + + + + +RE_FORMAT(7) BSD Reference Manual RE_FORMAT(7) + + + a range. + + Within a bracket expression, the name of a _c_h_a_r_a_c_t_e_r _c_l_a_s_s + enclosed in `[:' and `:]' stands for the list of all char- + acters belonging to that class. Standard character class + names are: + + alnum digit punct + alpha graph space + blank lower upper + cntrl print xdigit + + These stand for the character classes defined in _c_t_y_p_e(3). + A locale may provide others. A character class may not be + used as an endpoint of a range. + + There are two special cases|- of bracket expressions: the + bracket expressions `[[:<:]]' and `[[:>:]]' match the null + string at the beginning and end of a word respectively. A + word is defined as a sequence of _a_l_n_u_m characters (as + defined by _c_t_y_p_e(3)) which is neither preceded nor fol- + lowed by _a_l_n_u_m characters. This is an extension, compati- + ble with but not specified by POSIX 1003.2, and should be + used with caution in software intended to be portable to + other systems. + + In the event that an RE could match more than one sub- + string 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 ear- + lier in the RE taking priority over ones starting later. + Note that higher-level subexpressions thus take priority + over their lower-level component subexpressions. + + Match lengths are measured in characters, not collating + elements. A null string is considered longer than no + match at all. For example, `bb*' matches the three middle + characters of `abbbc', `(wee|week)(knights|nights)' + matches all ten characters of `weeknights', when `(.*).*' + is matched against `abc' the parenthesized subexpression + matches all three characters, and when `(a*)*' is matched + against `bc' both the whole RE and the parenthesized + subexpression match the null string. + + 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 + + + +4.4BSD June 4, 1993 3 + + + + + + + + +RE_FORMAT(7) BSD Reference Manual RE_FORMAT(7) + + + expression, it is effectively transformed into a bracket + expression containing both cases, e.g. `x' becomes `[xX]'. + When it appears inside a bracket expression, all case + counterparts of it are added to the bracket expression, so + that (e.g.) `[x]' becomes `[xX]' and `[^x]' becomes + `[^xX]'. + + No particular limit is imposed on the length of REs|-. + 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. + + Obsolete (``basic'') regular expressions differ in several + respects. `|', `+', and `?' are ordinary characters and + there is no equivalent for their functionality. The + delimiters for bounds are `\{' and `\}', with `{' and `}' + by themselves ordinary characters. The parentheses for + nested subexpressions are `\(' and `\)', with `(' and `)' + by themselves ordinary characters. `^' is an ordinary + character except at the beginning of the RE or|- the begin- + ning of a parenthesized subexpression, `$' is an ordinary + character except at the end of the RE or|- the end of a + parenthesized subexpression, and `*' is an ordinary char- + acter if it appears at the beginning of the RE or the + beginning of a parenthesized subexpression (after a possi- + ble leading `^'). Finally, there is one new type of atom, + a _b_a_c_k _r_e_f_e_r_e_n_c_e: `\' followed by a non-zero decimal digit + _d matches the same sequence of characters matched by the + _dth parenthesized subexpression (numbering subexpressions + by the positions of their opening parentheses, left to + right), so that (e.g.) `\([bc]\)\1' matches `bb' or `cc' + but not `bc'. + +SSEEEE AALLSSOO + regex(3) + + POSIX 1003.2, section 2.8 (Regular Expression Notation). + +BBUUGGSS + Having two kinds of REs is a botch. + + The current 1003.2 spec says that `)' is an ordinary char- + acter in the absence of an unmatched `('; this was an + unintentional result of a wording error, and change is + likely. Avoid relying on it. + + Back references are a dreadful botch, posing major prob- + lems for efficient implementations. They are also some- + what vaguely defined (does `a\(\(b\)*\2\)*d' match + `abbbd'?). Avoid using them. + + + + +4.4BSD June 4, 1993 4 + + + + + + + + +RE_FORMAT(7) BSD Reference Manual RE_FORMAT(7) + + + 1003.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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +4.4BSD June 4, 1993 5 + + + + + diff --git a/usr/src/Domestic/man/crypt.0.3 b/usr/src/Domestic/man/crypt.0.3 new file mode 100644 index 0000000000..af78b5cc72 --- /dev/null +++ b/usr/src/Domestic/man/crypt.0.3 @@ -0,0 +1,106 @@ +CRYPT(3) BSD Programmer's Manual CRYPT(3) + +NNAAMMEE + ccrryypptt, sseettkkeeyy, eennccrryypptt, ddeess__sseettkkeeyy, ddeess__cciipphheerr - DES encryption + +SSYYNNOOPPSSIISS + _c_h_a_r + **ccrryypptt(_c_o_n_s_t _c_h_a_r _*_k_e_y, _c_o_n_s_t _c_h_a_r _*_s_e_t_t_i_n_g); + + _i_n_t + sseettkkeeyy(_c_h_a_r _*_k_e_y); + + _i_n_t + eennccrryypptt(_c_h_a_r _*_b_l_o_c_k, _i_n_t _f_l_a_g); + + _i_n_t + ddeess__sseettkkeeyy(_c_o_n_s_t _c_h_a_r _*_k_e_y); + + _i_n_t + ddeess__cciipphheerr(_c_o_n_s_t _c_h_a_r _*_i_n, _c_h_a_r _*_o_u_t, _l_o_n_g _s_a_l_t, _i_n_t _c_o_u_n_t); + +DDEESSCCRRIIPPTTIIOONN + The crypt function performs password encryption. It is derived from the + NBS Data Encryption Standard. Additional code has been added to deter + key search attempts. The first argument to ccrryypptt is a NUL-terminated + string (normally a password typed by a user). The second is a character + array, 9 bytes in length, consisting of an underscore (``_'') followed by + 4 bytes of iteration count and 4 bytes of salt. Both the iteration _c_o_u_n_t + and the _s_a_l_t are encoded with 6 bits per character, least significant + bits first. The values 0 to 63 are encoded by the characters ``./0-9A- + Za-z'', respectively. + + The _s_a_l_t is used to induce disorder in to the DES algorithm in one of + 16777216 possible ways (specifically, if bit _i of the _s_a_l_t is set then + bits _i and _i_+_2_4 are swapped in the DES ``E'' box output). The _k_e_y is di- + vided into groups of 8 characters (a short final group is null-padded) + and the low-order 7 bits of each each character (56 bits per group) are + used to form the DES key as follows: the first group of 56 bits becomes + the initial DES key. For each additional group, the XOR of the group + bits and the encryption of the DES key with itself becomes the next DES + key. Then the final DES key is used to perform _c_o_u_n_t cumulative encryp- + tions of a 64-bit constant. The value returned is a NUL-terminated + string, 20 bytes in length, consisting of the _s_e_t_t_i_n_g followed by the en- + coded 64-bit encryption. + + For compatibility with historical versions of crypt(3), the _s_e_t_t_i_n_g may + consist of 2 bytes of salt, encoded as above, in which case an iteration + _c_o_u_n_t of 25 is used, fewer perturbations of DES are available, at most 8 + characters of _k_e_y are used, and the returned value is a NUL-terminated + string 13 bytes in length. + + The functions, eennccrryypptt(), sseettkkeeyy(), ddeess__sseettkkeeyy() and ddeess__cciipphheerr() allow + limited access to the DES algorithm itself. The _k_e_y argument to sseettkkeeyy() + is a 64 character array of binary values (numeric 0 or 1). A 56-bit key + is derived from this array by dividing the array into groups of 8 and ig- + noring the last bit in each group. + + The eennccrryypptt() argument _b_l_o_c_k is also a 64 character array of binary val- + ues. If the value of _f_l_a_g is 0, the argument _b_l_o_c_k is encrypted, other- + wise it is decrypted. The encryption or decryption is returned in the + original array _b_l_o_c_k after using the key specified by sseettkkeeyy() to process + it. + + The ddeess__sseettkkeeyy() and ddeess__cciipphheerr() functions are faster but less portable + than sseettkkeeyy() and eennccrryypptt(). The argument to ddeess__sseettkkeeyy() is a character + array of length 8. The _l_e_a_s_t significant bit in each character is ig- + nored and the next 7 bits of each character are concatenated to yield a + 56-bit key. The function ddeess__cciipphheerr() encrypts (or decrypts if _c_o_u_n_t is + negative) the 64-bits stored in the 8 characters at _i_n using abs(3) of + _c_o_u_n_t iterations of DES and stores the 64-bit result in the 8 characters + at _o_u_t. The _s_a_l_t specifies perturbations to DES as described above. + + The function ccrryypptt() returns a pointer to the encrypted value on success + and NULL on failure. The functions sseettkkeeyy(), eennccrryypptt(), ddeess__sseettkkeeyy(), + and ddeess__cciipphheerr() return 0 on success and 1 on failure. Historically, the + functions sseettkkeeyy() and eennccrryypptt() did not return any value. They have + been provided return values primarily to distinguish implementations + where hardware support is provided but not available or where the DES en- + cryption is not available due to the usual political silliness. + +SSEEEE AALLSSOO + login(1), passwd(1), getpass(3), passwd(5) + + + Wayne Patterson, _M_a_t_h_e_m_a_t_i_c_a_l _C_r_y_p_t_o_l_o_g_y _f_o_r _C_o_m_p_u_t_e_r _S_c_i_e_n_t_i_s_t_s _a_n_d + _M_a_t_h_e_m_a_t_i_c_i_a_n_s, ISBN 0-8476-7438-X, 1987. + + R. Morris, and Ken Thompson, "Password Security: A Case History", + _C_o_m_m_u_n_i_c_a_t_i_o_n_s _o_f _t_h_e _A_C_M, vol. 22, pp. 594-597, Nov. 1979. + + M.E. Hellman, "DES will be Totally Insecure within Ten Years", _I_E_E_E + _S_p_e_c_t_r_u_m, vol. 16, pp. 32-39, July 1979. + +HHIISSTTOORRYY + A rotor-based ccrryypptt() function appeared in Version 6 AT&T UNIX. The cur- + rent style ccrryypptt() first appeared in Version 7 AT&T UNIX. + +BBUUGGSS + Dropping the _l_e_a_s_t significant bit in each character of the argument to + ddeess__sseettkkeeyy() is ridiculous. + + The ccrryypptt() function leaves its result in an internal static object and + returns a pointer to that object. Subsequent calls to ccrryypptt() will modi- + fy the same object. + +4.4BSD June 4, 1993 2 -- 2.20.1