This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-10-03 21:52:11 +02:00
|
|
|
#ifndef __IPC_USOCKET_H__
|
|
|
|
#define __IPC_USOCKET_H__
|
2016-12-17 18:00:04 +01:00
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/un.h>
|
|
|
|
|
2016-12-18 00:54:43 +01:00
|
|
|
#define LISTEN_BACKLOG 128
|
|
|
|
|
2016-12-17 18:00:04 +01:00
|
|
|
// same as recv(2)
|
|
|
|
int usock_send (int fd, const char *buf, const int m_size);
|
|
|
|
|
|
|
|
// same as send(2)
|
|
|
|
// if msize == NULL => -1
|
|
|
|
// if buf == NULL => -1
|
|
|
|
// if *buf == NULL => allocation of *msize bytes
|
|
|
|
int usock_recv (int fd, char **buf, size_t *msize);
|
|
|
|
|
|
|
|
// same as close(2)
|
|
|
|
int usock_close (int fd);
|
|
|
|
|
|
|
|
// same as connect(2)
|
|
|
|
// if fd == NULL => -1
|
2016-12-18 00:54:43 +01:00
|
|
|
int usock_connect (int *fd, const char *path);
|
|
|
|
|
|
|
|
// if not ok => -1
|
|
|
|
// if ok => 0
|
|
|
|
int usock_init (int *fd, const char *path);
|
|
|
|
|
|
|
|
// if not ok => -1
|
|
|
|
// if ok => 0
|
|
|
|
int usock_accept (int fd, int *pfd);
|
|
|
|
|
|
|
|
// same as unlink(2)
|
|
|
|
int usock_remove (const char *path);
|
2016-12-17 18:00:04 +01:00
|
|
|
|
|
|
|
#endif
|