* These must return QCRYPTO_TLS_SESSION_ERR_BLOCK if the I/O
* would block, but on other errors, must fill 'errp'
*/
-typedef ssize_t (*QCryptoTLSSessionWriteFunc)(const char *buf,
+typedef ssize_t (*QCryptoTLSSessionWriteFunc)(const void *buf,
size_t len,
void *opaque,
Error **errp);
-typedef ssize_t (*QCryptoTLSSessionReadFunc)(char *buf,
+typedef ssize_t (*QCryptoTLSSessionReadFunc)(void *buf,
size_t len,
void *opaque,
Error **errp);
* a single memory region.
*/
ssize_t qio_channel_read(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp);
* single memory region.
*/
ssize_t qio_channel_write(QIOChannel *ioc,
- const char *buf,
+ const void *buf,
size_t buflen,
Error **errp);
* without data, or -1 on error
*/
int coroutine_mixed_fn qio_channel_read_all_eof(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp);
* Returns: 0 if all bytes were read, or -1 on error
*/
int coroutine_mixed_fn qio_channel_read_all(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp);
* Returns: 0 if all bytes were written, or -1 on error
*/
int coroutine_mixed_fn qio_channel_write_all(QIOChannel *ioc,
- const char *buf,
+ const void *buf,
size_t buflen,
Error **errp);
* flag QIO_CHANNEL_FEATURE_SEEKABLE prior to calling this method.
*
*/
-ssize_t qio_channel_pwrite(QIOChannel *ioc, char *buf, size_t buflen,
+ssize_t qio_channel_pwrite(QIOChannel *ioc, void *buf, size_t buflen,
off_t offset, Error **errp);
/**
* flag QIO_CHANNEL_FEATURE_SEEKABLE prior to calling this method.
*
*/
-ssize_t qio_channel_pread(QIOChannel *ioc, char *buf, size_t buflen,
+ssize_t qio_channel_pread(QIOChannel *ioc, void *buf, size_t buflen,
off_t offset, Error **errp);
/**
#include "qemu/atomic.h"
-static ssize_t qio_channel_tls_write_handler(const char *buf,
+static ssize_t qio_channel_tls_write_handler(const void *buf,
size_t len,
void *opaque,
Error **errp)
return ret;
}
-static ssize_t qio_channel_tls_read_handler(char *buf,
+static ssize_t qio_channel_tls_read_handler(void *buf,
size_t len,
void *opaque,
Error **errp)
ssize_t qio_channel_read(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp)
{
ssize_t qio_channel_write(QIOChannel *ioc,
- const char *buf,
+ const void *buf,
size_t buflen,
Error **errp)
{
int coroutine_mixed_fn qio_channel_read_all_eof(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp)
{
int coroutine_mixed_fn qio_channel_read_all(QIOChannel *ioc,
- char *buf,
+ void *buf,
size_t buflen,
Error **errp)
{
int coroutine_mixed_fn qio_channel_write_all(QIOChannel *ioc,
- const char *buf,
+ const void *buf,
size_t buflen,
Error **errp)
{
return klass->io_pwritev(ioc, iov, niov, offset, errp);
}
-ssize_t qio_channel_pwrite(QIOChannel *ioc, char *buf, size_t buflen,
+ssize_t qio_channel_pwrite(QIOChannel *ioc, void *buf, size_t buflen,
off_t offset, Error **errp)
{
struct iovec iov = {
return klass->io_preadv(ioc, iov, niov, offset, errp);
}
-ssize_t qio_channel_pread(QIOChannel *ioc, char *buf, size_t buflen,
+ssize_t qio_channel_pread(QIOChannel *ioc, void *buf, size_t buflen,
off_t offset, Error **errp)
{
struct iovec iov = {
#define KEYFILE WORKDIR "key-ctx.pem"
static ssize_t
-testWrite(const char *buf, size_t len, void *opaque, Error **errp)
+testWrite(const void *buf, size_t len, void *opaque, Error **errp)
{
int *fd = opaque;
int ret;
}
static ssize_t
-testRead(char *buf, size_t len, void *opaque, Error **errp)
+testRead(void *buf, size_t len, void *opaque, Error **errp)
{
int *fd = opaque;
int ret;