- djm@cvs.openbsd.org 2013/10/17 00:30:13
     [PROTOCOL sftp-client.c sftp-client.h sftp-server.c sftp.1 sftp.c]
     fsync@openssh.com protocol extension for sftp-server
     client support to allow calling fsync() faster successful transfer
     patch mostly by imorgan AT nas.nasa.gov; bz#1798
     "fine" markus@ "grumble OK" deraadt@ "doesn't sound bad to me" millert@
diff --git a/sftp.1 b/sftp.1
index 85d64a7..9809bec 100644
--- a/sftp.1
+++ b/sftp.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sftp.1,v 1.94 2013/08/07 06:24:51 jmc Exp $
+.\" $OpenBSD: sftp.1,v 1.95 2013/10/17 00:30:13 djm Exp $
 .\"
 .\" Copyright (c) 2001 Damien Miller.  All rights reserved.
 .\"
@@ -22,7 +22,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: August 7 2013 $
+.Dd $Mdocdate: October 17 2013 $
 .Dt SFTP 1
 .Os
 .Sh NAME
@@ -31,7 +31,7 @@
 .Sh SYNOPSIS
 .Nm sftp
 .Bk -words
-.Op Fl 1246aCpqrv
+.Op Fl 1246aCfpqrv
 .Op Fl B Ar buffer_size
 .Op Fl b Ar batchfile
 .Op Fl c Ar cipher
@@ -164,6 +164,10 @@
 .Xr ssh 1 .
 This option is directly passed to
 .Xr ssh 1 .
+.It Fl f
+Requests that files be flushed to disk immediately after transfer.
+When uploading files, this feature is only enabled if the server
+implements the "fsync@openssh.com" extension.
 .It Fl i Ar identity_file
 Selects the file from which the identity (private key) for public key
 authentication is read.
@@ -348,7 +352,7 @@
 Quit
 .Nm sftp .
 .It Xo Ic get
-.Op Fl aPpr
+.Op Fl afPpr
 .Ar remote-path
 .Op Ar local-path
 .Xc
@@ -376,6 +380,13 @@
 If the remote file contents differ from the partial local copy then the
 resultant file is likely to be corrupt.
 .Pp
+If the
+.Fl f
+flag is specified, then
+.Xr fsync 2
+will ba called after the file transfer has completed to flush the file
+to disk.
+.Pp
 If either the
 .Fl P
 or
@@ -479,7 +490,7 @@
 .It Ic progress
 Toggle display of progress meter.
 .It Xo Ic put
-.Op Fl Ppr
+.Op Fl fPpr
 .Ar local-path
 .Op Ar remote-path
 .Xc
@@ -498,6 +509,14 @@
 .Ar remote-path
 must specify a directory.
 .Pp
+If the
+.Fl f
+flag is specified, then a request will be sent to the server to call
+.Xr fsync 2
+after the file has been transferred.
+Note that this is only supported by servers that implement
+the "fsync@openssh.com" extension.
+.Pp
 If either the
 .Fl P
 or