From da88330aaaf865884c9af2df08f70b7faf8c5b90 Mon Sep 17 00:00:00 2001 From: dg Date: Mon, 1 Dec 2003 22:12:50 +0000 Subject: Fixed a bug in sendfile(2) where the sent data would be corrupted due to sendfile(2) being erroneously automatically restarted after a signal is delivered. Fixed by converting ERESTART to EINTR prior to exiting. Updated manual page to indicate the potential EINTR error, its cause and consequences. Approved by: re@freebsd.org --- lib/libc/sys/sendfile.2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/libc/sys') diff --git a/lib/libc/sys/sendfile.2 b/lib/libc/sys/sendfile.2 index 96979ee..e2cac6a 100644 --- a/lib/libc/sys/sendfile.2 +++ b/lib/libc/sys/sendfile.2 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998, David Greenman +.\" Copyright (c) 2003, David G. Lawrence .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -191,6 +191,10 @@ An error occurred while reading from .Fa fd . .It Bq Er EFAULT An invalid address was specified for an argument. +.It Bq Er EINTR +A signal interrupted sendfile before it could be completed. If specified, the number +of bytes successfully sent will be returned in +.Fa *sbytes . .It Bq Er EAGAIN The socket is marked for non-blocking I/O and not all data was sent due to the socket buffer being filled. If specified, the number of bytes successfully sent will be returned in @@ -215,4 +219,4 @@ The .Fn sendfile system call and this manual page were written by -.An David Greenman Aq dg@root.com . +.An David G. Lawrence Aq dg@dglawrence.com . -- cgit v1.1