1 /*
2  * Copyright (c) 2024 Abhinav Srivastava
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <errno.h>
8 #include <stdarg.h>
9 
10 #include <zephyr/kernel.h>
11 #include <zephyr/posix/stropts.h>
12 
putmsg(int fildes,const struct strbuf * ctlptr,const struct strbuf * dataptr,int flags)13 int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags)
14 {
15 	ARG_UNUSED(fildes);
16 	ARG_UNUSED(ctlptr);
17 	ARG_UNUSED(dataptr);
18 	ARG_UNUSED(flags);
19 
20 	errno = ENOSYS;
21 	return -1;
22 }
23 
putpmsg(int fildes,const struct strbuf * ctlptr,const struct strbuf * dataptr,int band,int flags)24 int putpmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int band,
25 	    int flags)
26 {
27 	ARG_UNUSED(fildes);
28 	ARG_UNUSED(ctlptr);
29 	ARG_UNUSED(dataptr);
30 	ARG_UNUSED(band);
31 	ARG_UNUSED(flags);
32 
33 	errno = ENOSYS;
34 	return -1;
35 }
36 
fdetach(const char * path)37 int fdetach(const char *path)
38 {
39 	ARG_UNUSED(path);
40 
41 	errno = ENOSYS;
42 	return -1;
43 }
44 
fattach(int fildes,const char * path)45 int fattach(int fildes, const char *path)
46 {
47 	ARG_UNUSED(fildes);
48 	ARG_UNUSED(path);
49 	errno = ENOSYS;
50 
51 	return -1;
52 }
53 
getmsg(int fildes,struct strbuf * ctlptr,struct strbuf * dataptr,int * flagsp)54 int getmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
55 {
56 	ARG_UNUSED(fildes);
57 	ARG_UNUSED(ctlptr);
58 	ARG_UNUSED(dataptr);
59 	ARG_UNUSED(flagsp);
60 
61 	errno = ENOSYS;
62 	return -1;
63 }
64 
getpmsg(int fildes,struct strbuf * ctlptr,struct strbuf * dataptr,int * bandp,int * flagsp)65 int getpmsg(int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp, int *flagsp)
66 {
67 	ARG_UNUSED(fildes);
68 	ARG_UNUSED(ctlptr);
69 	ARG_UNUSED(dataptr);
70 	ARG_UNUSED(bandp);
71 	ARG_UNUSED(flagsp);
72 
73 	errno = ENOSYS;
74 	return -1;
75 }
76 
isastream(int fildes)77 int isastream(int fildes)
78 {
79 	ARG_UNUSED(fildes);
80 
81 	errno = ENOSYS;
82 	return -1;
83 }
84 
85 extern int zvfs_ioctl(int fd, unsigned long request, va_list args);
86 
ioctl(int fd,unsigned long request,...)87 int ioctl(int fd, unsigned long request, ...)
88 {
89 	int ret;
90 	va_list args;
91 
92 	va_start(args, request);
93 	ret = zvfs_ioctl(fd, request, args);
94 	va_end(args);
95 
96 	return ret;
97 }
98