db_eventfd.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (C) 2019 Intel Corporation
  2. This file is part of Graphene Library OS.
  3. Graphene Library OS is free software: you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public License
  5. as published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. Graphene Library OS is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /*
  14. * db_eventfd.c
  15. *
  16. * This file contains operations to handle streams with URIs that have "eventfd:".
  17. */
  18. #include "api.h"
  19. #include "pal.h"
  20. #include "pal_defs.h"
  21. #include "pal_error.h"
  22. #include "pal_internal.h"
  23. /* `type` must be eventfd, `uri` & `access` & `share` are unused, `create` holds eventfd's initval,
  24. * `options` holds eventfd's flags */
  25. static int eventfd_pal_open(PAL_HANDLE* handle, const char* type, const char* uri, int access,
  26. int share, int create, int options) {
  27. return -PAL_ERROR_NOTIMPLEMENTED;
  28. }
  29. /* offset does not apply here. */
  30. static int64_t eventfd_pal_read(PAL_HANDLE handle, uint64_t offset, uint64_t len, void* buffer) {
  31. return -PAL_ERROR_NOTIMPLEMENTED;
  32. }
  33. /* offset does not apply here. */
  34. static int64_t eventfd_pal_write(PAL_HANDLE handle, uint64_t offset, uint64_t len,
  35. const void* buffer) {
  36. return -PAL_ERROR_NOTIMPLEMENTED;
  37. }
  38. /* gets used for polling(query) on eventfd from LibOS. */
  39. static int eventfd_pal_attrquerybyhdl(PAL_HANDLE handle, PAL_STREAM_ATTR* attr) {
  40. return -PAL_ERROR_NOTIMPLEMENTED;
  41. }
  42. static int eventfd_pal_close(PAL_HANDLE handle) {
  43. return -PAL_ERROR_NOTIMPLEMENTED;
  44. }
  45. struct handle_ops eventfd_ops = {
  46. .open = &eventfd_pal_open,
  47. .read = &eventfd_pal_read,
  48. .write = &eventfd_pal_write,
  49. .close = &eventfd_pal_close,
  50. .attrquerybyhdl = &eventfd_pal_attrquerybyhdl,
  51. };