sys_file.in.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Provide a more complete sys/file.h.
  2. Copyright (C) 2007-2012 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program 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, write to the Free Software Foundation,
  13. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  14. /* Written by Richard W.M. Jones. */
  15. #ifndef _@GUARD_PREFIX@_SYS_FILE_H
  16. #if __GNUC__ >= 3
  17. @PRAGMA_SYSTEM_HEADER@
  18. #endif
  19. @PRAGMA_COLUMNS@
  20. /* The include_next requires a split double-inclusion guard. */
  21. #if @HAVE_SYS_FILE_H@
  22. # @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@
  23. #endif
  24. #ifndef _@GUARD_PREFIX@_SYS_FILE_H
  25. #define _@GUARD_PREFIX@_SYS_FILE_H
  26. #ifndef LOCK_SH
  27. /* Operations for the 'flock' call (same as Linux kernel constants). */
  28. # define LOCK_SH 1 /* Shared lock. */
  29. # define LOCK_EX 2 /* Exclusive lock. */
  30. # define LOCK_UN 8 /* Unlock. */
  31. /* Can be OR'd in to one of the above. */
  32. # define LOCK_NB 4 /* Don't block when locking. */
  33. #endif
  34. /* The definition of _GL_WARN_ON_USE is copied here. */
  35. #if @GNULIB_FLOCK@
  36. /* Apply or remove advisory locks on an open file.
  37. Return 0 if successful, otherwise -1 and errno set. */
  38. # if !@HAVE_FLOCK@
  39. extern int flock (int fd, int operation);
  40. # endif
  41. #elif defined GNULIB_POSIXCHECK
  42. # undef flock
  43. # if HAVE_RAW_DECL_FLOCK
  44. _GL_WARN_ON_USE (flock, "flock is unportable - "
  45. "use gnulib module flock for portability");
  46. # endif
  47. #endif
  48. #endif /* _@GUARD_PREFIX@_SYS_FILE_H */
  49. #endif /* _@GUARD_PREFIX@_SYS_FILE_H */