file.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright (C) 1991, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library 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 GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_FILE_H
  15. #define _SYS_FILE_H 1
  16. #include <features.h>
  17. #ifndef _FCNTL_H
  18. # include <fcntl.h>
  19. #endif
  20. __BEGIN_DECLS
  21. /* Alternate names for values for the WHENCE argument to `lseek'.
  22. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
  23. #ifndef L_SET
  24. # define L_SET 0 /* Seek from beginning of file. */
  25. # define L_INCR 1 /* Seek from current position. */
  26. # define L_XTND 2 /* Seek from end of file. */
  27. #endif
  28. /* Operations for the `flock' call. */
  29. #define LOCK_SH 1 /* Shared lock. */
  30. #define LOCK_EX 2 /* Exclusive lock. */
  31. #define LOCK_UN 8 /* Unlock. */
  32. /* Can be OR'd in to one of the above. */
  33. #define LOCK_NB 4 /* Don't block when locking. */
  34. /* Apply or remove an advisory lock, according to OPERATION,
  35. on the file FD refers to. */
  36. extern int flock (int __fd, int __operation) __THROW;
  37. __END_DECLS
  38. #endif /* sys/file.h */