write.2 (121011) | write.2 (131504) |
---|---|
1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)write.2 8.5 (Berkeley) 4/2/94 | 1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)write.2 8.5 (Berkeley) 4/2/94 |
33.\" $FreeBSD: head/lib/libc/sys/write.2 121011 2003-10-11 20:47:44Z dds $ | 33.\" $FreeBSD: head/lib/libc/sys/write.2 131504 2004-07-02 23:52:20Z ru $ |
34.\" 35.Dd April 2, 1994 36.Dt WRITE 2 37.Os 38.Sh NAME 39.Nm write , 40.Nm writev , 41.Nm pwrite --- 65 unchanged lines hidden (view full) --- 107.Fa d , 108see 109.Xr lseek 2 . 110Upon return from 111.Fn write , 112the pointer is incremented by the number of bytes which were written. 113.Pp 114Objects that are not capable of seeking always write from the current | 34.\" 35.Dd April 2, 1994 36.Dt WRITE 2 37.Os 38.Sh NAME 39.Nm write , 40.Nm writev , 41.Nm pwrite --- 65 unchanged lines hidden (view full) --- 107.Fa d , 108see 109.Xr lseek 2 . 110Upon return from 111.Fn write , 112the pointer is incremented by the number of bytes which were written. 113.Pp 114Objects that are not capable of seeking always write from the current |
115position. The value of the pointer associated with such an object | 115position. 116The value of the pointer associated with such an object |
116is undefined. 117.Pp 118If the real user is not the super-user, then 119.Fn write 120clears the set-user-id bit on a file. 121This prevents penetration of system security 122by a user who 123.Dq captures --- 5 unchanged lines hidden (view full) --- 129.Fn write 130and 131.Fn writev 132may write fewer bytes than requested; 133the return value must be noted, 134and the remainder of the operation should be retried when possible. 135.Sh RETURN VALUES 136Upon successful completion the number of bytes which were written | 117is undefined. 118.Pp 119If the real user is not the super-user, then 120.Fn write 121clears the set-user-id bit on a file. 122This prevents penetration of system security 123by a user who 124.Dq captures --- 5 unchanged lines hidden (view full) --- 130.Fn write 131and 132.Fn writev 133may write fewer bytes than requested; 134the return value must be noted, 135and the remainder of the operation should be retried when possible. 136.Sh RETURN VALUES 137Upon successful completion the number of bytes which were written |
137is returned. Otherwise a -1 is returned and the global variable | 138is returned. 139Otherwise a -1 is returned and the global variable |
138.Va errno 139is set to indicate the error. 140.Sh ERRORS 141The 142.Fn write , 143.Fn writev , 144and 145.Fn pwrite --- 120 unchanged lines hidden --- | 140.Va errno 141is set to indicate the error. 142.Sh ERRORS 143The 144.Fn write , 145.Fn writev , 146and 147.Fn pwrite --- 120 unchanged lines hidden --- |