Archived
3
0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
libipc-old/core/usocket.h

38 lines
742 B
C
Raw Normal View History

2016-12-17 18:00:04 +01:00
#ifndef __USOCKET_H__
#define __USOCKET_H__
#include <time.h>
#include <sys/socket.h>
#include <sys/un.h>
#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
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