Commit Graph

45 Commits

Author SHA1 Message Date
Benedict Reuschling
44b0b943b8 Revert "Add extra EINVAL information about wrong block size to read(2)/write(2)"
This reverts commit 1c2be25f60.

kib@ pointed out that it is perfectly fine to write at arbitrary regular
file offsets. For example, in a 4K block size character device, geom
doesn't support writing / reading 515 byte blocks. The description is
perhaps not applicable to all EINVALs returned.
2022-10-08 10:23:51 +00:00
Benedict Reuschling
1c2be25f60 Add extra EINVAL information about wrong block size to read(2)/write(2)
The read system call will return EINVAL if the current file offset is
not a multiple of the block size. This also applies to write(2). Add an
entry for EINVAL about this error to both man pages.

PR:			91149
Event:			Aberdeen Hackathon 2022
Differential Revision:	https://reviews.freebsd.org/D24617
2022-10-07 11:32:37 +00:00
Guangyuan Yang
504e64af32 pwrite(2): add a BUGS section
Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd.

MFC after:	3 days
Submitted by:	Ka Ho Ng <khng300@gmail.com>
Reviewed by:	gbe, yuripv
Differential Revision:	https://reviews.freebsd.org/D28372
2021-02-20 08:05:43 +00:00
John-Mark Gurney
0fda26dbb3 update write(2)'s iovec limit w/ info about the iosize_max_clamp sysctl... 2020-10-26 00:37:31 +00:00
John Baldwin
e42b096439 Document EINTEGRITY errors for many system calls.
EINTEGRITY was previously documented as a UFS-specific error for
mount(2).  This documents EINTEGRITY as a filesystem-independent error
that may be reported by the backing store of a filesystem.

While here, document EIO as a filesystem-independent error for both
mount(2) and posix_fadvise(2).  EIO was previously only documented for
UFS for mount(2).

Reviewed by:	mckusick
Suggested by:	mckusick
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24168
2020-03-30 21:44:00 +00:00
Warner Losh
aeb71118e6 Mark all the system calls that were in 1st Edition Unix as such in the
HISTORY section. Note: Any system calls that were added prior to v7,
but after v1 weren't changed.

Obtained from: http://www.tuhs.org/cgi-bin/utree.pl?file=V1/man/man2
2017-12-01 22:26:36 +00:00
Ed Maste
31a4787b80 write.2: correct maximum nbytes size for EINVAL error
In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.

PR:		196666
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-10-17 02:51:45 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Kevin Lo
d0ec8fd065 Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h. 2015-12-15 15:19:06 +00:00
Bryan Drewery
c36029e6dc Consistently reference file descriptors as "fd". 55 other manpages
used "fd", while these used "d" and "filedes".

MFC after:	1 week
Approved by:	gjb
Approved by:	re (delphij)
2013-09-12 00:53:38 +00:00
Pawel Jakub Dawidek
e0c980d95d The sys/uio.h header is needed only for readv(2), preadv(2), writev(2) and
pwritev(2). Document it more precisely.

Reviewed by:	jilles
MFC after:	3 days
2012-01-22 11:15:48 +00:00
Warner Losh
c879ae3536 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Simon L. B. Nielsen
27111d392c Minor markup fix: A comma should be seperated by space from macro
argument.  This resulted in "pwritev,()" instead of the intended
"pwritev()," in the output.

MFC after:	3 days
2006-10-21 20:36:50 +00:00
Ruslan Ermilov
1427d59bee List pwritev in the NAME section. 2006-04-14 19:34:07 +00:00
Ruslan Ermilov
110e1704d3 -mdoc sweep. 2005-11-17 13:00:00 +00:00
John Baldwin
bcd9e0dd20 - Add two new system calls: preadv() and pwritev() which are like readv()
and writev() except that they take an additional offset argument and do
  not change the current file position.  In SAT speak:
  preadv:readv::pread:read and pwritev:writev::pwrite:write.
- Try to reduce code duplication some by merging most of the old
  kern_foov() and dofilefoo() functions into new dofilefoo() functions
  that are called by kern_foov() and kern_pfoov().  The non-v functions
  now all generate a simple uio on the stack from the passed in arguments
  and then call kern_foov().  For example, read() now just builds a uio and
  calls kern_readv() and pwrite() just builds a uio and calls kern_pwritev().

PR:		kern/80362
Submitted by:	Marc Olzheim marcolz at stack dot nl (1)
Approved by:	re (scottl)
MFC after:	1 week
2005-07-07 18:17:55 +00:00
Colin Percival
75fa96cc9b read(), pread(), write(), and pwrite() return EINVAL if they are asked
for more than INT_MAX bytes.
2005-02-10 20:09:01 +00:00
Yaroslav Tykhiy
a39fd5061b Reword the last change a bit, add mdoc(7) markup.
Discussed with:	bde
2004-10-25 13:35:03 +00:00
Yaroslav Tykhiy
9a0cabd9e4 Explain it is a negative offset that EINVAL may indicate.
Now readers won't get an impression that pointing to beyond
the current end of file will result in EINVAL.

MFC after:	1 week
2004-10-16 09:53:35 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
Diomidis Spinellis
638f4836e3 Changed EINVAL constant reference from UIO_MAXIOV to IOV_MAX.
The former is a kernel-only visible constant, the latter the
POSIX-specified userland constant defined by including limits.h.
2003-10-11 20:47:44 +00:00
Mike Barcroft
0f0ca6ffc9 Fix struct iovec documentation to match reality.
Submitted by:	Craig Rodrigues <rodrigc@attbi.com>
2003-01-12 15:18:47 +00:00
Ruslan Ermilov
2efeeba554 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
Ruslan Ermilov
2faeeff4c9 mdoc(7) police: Tidy up the syscall language.
Stop calling system calls "function calls".

Use "The .Fn system call" a-la "The .Nm utility".

When referring to a non-BSD implementation in
the HISTORY section, call syscall a function,
to be safe.
2002-12-18 09:22:32 +00:00
Jens Schweikhardt
b2aa8b2a98 Document that write(2) et al can return EROFS for attempts to write the
disk label area.

PR:		43891
Submitted by:	Diomidis D. Spinellis <dds@istlab.dmst.aueb.gr>
MFC after:	3 days
2002-10-10 19:16:10 +00:00
Ruslan Ermilov
db8caf03e5 Remove the internal implementation details of wrapping syscalls,
which do not match the reality anyway.

Approved by:	deischen, bde
2001-10-26 17:38:20 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Jason Evans
789d148cca Document the EINTR error. 2001-02-26 09:38:01 +00:00
Chris Costello
bb33e42207 Replace .Va, .Ar and .Nm with .Fa or .Va where necessary, examples:
``.Ar errno'' -> ``.Va errno''
  ``.Nm ops'' -> ``.Fa ops''
  ``.Va fd'' -> ``.Fa fd''
2000-06-23 05:05:44 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Nik Clayton
83f7951bfc Document that writev(2) can fail with ENOBUFS.
Text is a compromise based on messages from Wes Peters, Ville-Pertti
Keinonen, and Matt Dillon.

PR:             docs/10512
Submitted by:   Howard Goldstein <hgoldst@mpcs.com>
1999-07-30 21:20:09 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
Guy Helmer
a2b79fbea1 writev(2) can return EDESTADDRREQ when attempting to write to a
UNIX domain socket on which connect(2) had been used to set a destination
address and the destination goes away.

PR:		docs/10451
1999-05-04 20:07:44 +00:00
Dmitrij Tejblum
88874fcfe6 Document pread() and pwrite().
Obtained from:	NetBSD (mostly)
1999-04-11 21:14:40 +00:00
Mike Pritchard
f71a0a5ba8 Update to reflect current include files. 1997-01-30 22:39:40 +00:00
Wolfram Schneider
fd3bf33fd0 upgrade STANDARDS from POSIX 1003.1-88 to 1003.1-90 using .St macro
use ``is expected to conform to'' phrase, not ``conforms to''

Pointed out by: Bruce->NIST-PCTS
1996-12-02 20:03:58 +00:00
Bruce Evans
35ecc2f917 .DV -> .Dv (SOCK_STREAM was invisible). 1996-09-28 13:32:35 +00:00
Mike Pritchard
7bdf80e571 Correctly use .Fn instead of .Nm to reference function names
in a bunch of man pages.

Use the correct .Bx  (BSD UNIX) or .At (AT&T UNIX) macros
instead of explicitly specifying the version in the text
in a bunch of man pages.
1996-08-22 23:31:07 +00:00
Julian Elischer
f70177e76e Reviewed by: julian and (hsu?)
Submitted by:	 John Birrel(L?)

changes for threadsafe operations
1996-01-22 00:02:33 +00:00
Rodney W. Grimes
58f0484fa2 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00