static int rmtcall(char *cmd, char *buf) { if (rmtpush(buf, strlen(buf)) != strlen(buf)) rmtconnaborted(0); return (rmtreply(cmd)); }
static int rmtcall(const char *cmd, const char *buf) { if (write(rmtape, buf, strlen(buf)) != strlen(buf)) rmtconnaborted(0); return (rmtreply(cmd)); }
static int rmtcall(const char *cmd, const char *buf) { ssize_t len = (ssize_t)strlen(buf); if (write(rmtape, buf, len) != len) rmtconnaborted(0); return (rmtreply(cmd)); }
int rmtwrite(const char *buf, int count) { char line[30]; (void)snprintf(line, sizeof (line), "W%d\n", count); write(rmtape, line, strlen(line)); write(rmtape, buf, count); return (rmtreply("write")); }
int rmtwrite(char *buf, uint_t count) { int retval; char line[64]; /* numbers can get big */ (void) snprintf(line, sizeof (line), "W%d\n", count); retval = rmtpush(line, strlen(line)); if (retval <= 0) return (-1); retval = rmtpush(buf, count); if (retval <= 0) return (-1); return (rmtreply("write")); }
int rmtwrite2(void) { return (rmtreply("write")); }