pipe.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * pipe.h
  3. *
  4. * Copyright (C) 2017 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __MONOLITHIUM_PIPE_H__
  20. #define __MONOLITHIUM_PIPE_H__
  21. #include "object.h"
  22. #define PIPELINE_REQUEST_ONLY (1 << 0)
  23. #define PIPELINE_REQUEST_MESSAGE (1 << 1)
  24. #define PIPELINE_RESPONSE_MESSAGE (1 << 2)
  25. typedef struct
  26. {
  27. dword_t master_pid;
  28. dword_t slave_pid;
  29. handle_t request_pipe;
  30. handle_t response_pipe;
  31. } pipe_connection_t;
  32. sysret_t syscall_create_pipeline(const char *name, dword_t flags, access_flags_t access, handle_t *handle);
  33. sysret_t syscall_open_pipeline(const char *name, access_flags_t access, handle_t *handle);
  34. sysret_t syscall_listen_pipeline(handle_t handle, dword_t timeout, pipe_connection_t *connection);
  35. sysret_t syscall_connect_pipeline(handle_t handle, access_flags_t access, pipe_connection_t *connection);
  36. sysret_t syscall_read_pipe(handle_t handle, void *buffer, dword_t *size, dword_t timeout);
  37. sysret_t syscall_write_pipe(handle_t handle, void *buffer, dword_t size);
  38. #endif