misc.c : Introduce ssh_writen()

A call to write() may perform a short write on a local file.
To avoid short writes, ssh_writen() can be used.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
Eshan Kelkar
2023-07-25 00:30:27 +05:30
committed by Jakub Jelen
parent e4c13817cc
commit 85d7cc5cf2
2 changed files with 52 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ int ssh_tmpname(char *name);
char *ssh_strreplace(const char *src, const char *pattern, const char *repl);
ssize_t ssh_readn(int fd, void *buf, size_t nbytes);
ssize_t ssh_writen(int fd, const void *buf, size_t nbytes);
#ifdef __cplusplus
}