posix: Implement getmsg and getpmsg

`getmsg()` and `getpmsg()` are required
as part of _XOPEN_STREAMS Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
This commit is contained in:
Gaetan Perrot 2024-02-05 11:16:34 +09:00 committed by Alberto Escolar
parent 6ce38c1aa7
commit 6badcad883
2 changed files with 25 additions and 0 deletions

View file

@ -20,6 +20,8 @@ struct strbuf {
int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags);
int fdetach(const char *path);
int fattach(int fildes, const char *path);
int getmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp);
int getpmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp, int *flagsp);
#ifdef __cplusplus
}

View file

@ -31,6 +31,29 @@ int fattach(int fildes, const char *path)
{
ARG_UNUSED(fildes);
ARG_UNUSED(path);
errno = ENOSYS;
return -1;
}
int getmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
{
ARG_UNUSED(fildes);
ARG_UNUSED(ctlptr);
ARG_UNUSED(dataptr);
ARG_UNUSED(flagsp);
errno = ENOSYS;
return -1;
}
int getpmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp, int *flagsp)
{
ARG_UNUSED(fildes);
ARG_UNUSED(ctlptr);
ARG_UNUSED(dataptr);
ARG_UNUSED(bandp);
ARG_UNUSED(flagsp);
errno = ENOSYS;
return -1;