Add patty_client_read(), patty_client_write()
Add patty_client_read(), patty_client_write() to allow direct I/O with a pattyd(8) process from a patty_client object
This commit is contained in:
parent
df84f68678
commit
3cf9d4093a
2 changed files with 12 additions and 0 deletions
|
@ -30,6 +30,10 @@ patty_client *patty_client_new(const char *path);
|
||||||
|
|
||||||
void patty_client_destroy(patty_client *client);
|
void patty_client_destroy(patty_client *client);
|
||||||
|
|
||||||
|
ssize_t patty_client_read(patty_client *client, void *buf, size_t len);
|
||||||
|
|
||||||
|
ssize_t patty_client_write(patty_client *client, const void *buf, size_t len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ping()
|
* ping()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -48,6 +48,14 @@ error_malloc_client:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ssize_t patty_client_read(patty_client *client, void *buf, size_t len) {
|
||||||
|
return read(client->fd, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
ssize_t patty_client_write(patty_client *client, const void *buf, size_t len) {
|
||||||
|
return write(client->fd, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
static int request_close(patty_client *client,
|
static int request_close(patty_client *client,
|
||||||
int fd) {
|
int fd) {
|
||||||
enum patty_client_call call = PATTY_CLIENT_CLOSE;
|
enum patty_client_call call = PATTY_CLIENT_CLOSE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue