ext4_oflags.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2015 Grzegorz Kostka (kostka.grzegorz@gmail.com)
  3. * Copyright (c) 2015 Kaho Ng (ngkaho1234@gmail.com)
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * - Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * - Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * - The name of the author may not be used to endorse or promote products
  16. * derived from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. /** @addtogroup lwext4
  30. * @{
  31. */
  32. /**
  33. * @file ext4_oflags.h
  34. * @brief File opening & seeking flags.
  35. */
  36. #ifndef EXT4_OFLAGS_H_
  37. #define EXT4_OFLAGS_H_
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /********************************FILE OPEN FLAGS*****************************/
  42. #if CONFIG_HAVE_OWN_OFLAGS
  43. #ifndef O_RDONLY
  44. #define O_RDONLY 00
  45. #endif
  46. #ifndef O_WRONLY
  47. #define O_WRONLY 01
  48. #endif
  49. #ifndef O_RDWR
  50. #define O_RDWR 02
  51. #endif
  52. #ifndef O_CREAT
  53. #define O_CREAT 0100
  54. #endif
  55. #ifndef O_EXCL
  56. #define O_EXCL 0200
  57. #endif
  58. #ifndef O_TRUNC
  59. #define O_TRUNC 01000
  60. #endif
  61. #ifndef O_APPEND
  62. #define O_APPEND 02000
  63. #endif
  64. /********************************FILE SEEK FLAGS*****************************/
  65. #ifndef SEEK_SET
  66. #define SEEK_SET 0
  67. #endif
  68. #ifndef SEEK_CUR
  69. #define SEEK_CUR 1
  70. #endif
  71. #ifndef SEEK_END
  72. #define SEEK_END 2
  73. #endif
  74. #else
  75. #include <unistd.h>
  76. #include <fcntl.h>
  77. #endif
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif /* EXT4_OFLAGS_H_ */
  82. /**
  83. * @}
  84. */