send.c 446 B

12345678910111213141516171819202122232425262728293031
  1. /* posix */
  2. #include <sys/types.h>
  3. #include <unistd.h>
  4. #include <fcntl.h>
  5. #include <errno.h>
  6. /* bsd extensions */
  7. #include <sys/uio.h>
  8. #include <sys/socket.h>
  9. #include "priv.h"
  10. int
  11. send(int fd, char *a, int n, int flags)
  12. {
  13. if(flags & MSG_OOB){
  14. errno = EOPNOTSUPP;
  15. return -1;
  16. }
  17. return write(fd, a, n);
  18. }
  19. int
  20. recv(int fd, char *a, int n, int flags)
  21. {
  22. if(flags & MSG_OOB){
  23. errno = EOPNOTSUPP;
  24. return -1;
  25. }
  26. return read(fd, a, n);
  27. }