file.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_FILE_H
  16. #define _SYS_FILE_H 1
  17. #include <features.h>
  18. #ifndef _FCNTL_H
  19. # include <fcntl.h>
  20. #endif
  21. __BEGIN_DECLS
  22. /* Alternate names for values for the WHENCE argument to `lseek'.
  23. These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
  24. #ifndef L_SET
  25. # define L_SET 0 /* Seek from beginning of file. */
  26. # define L_INCR 1 /* Seek from current position. */
  27. # define L_XTND 2 /* Seek from end of file. */
  28. #endif
  29. /* Operations for the `flock' call. */
  30. #define LOCK_SH 1 /* Shared lock. */
  31. #define LOCK_EX 2 /* Exclusive lock. */
  32. #define LOCK_UN 8 /* Unlock. */
  33. /* Can be OR'd in to one of the above. */
  34. #define LOCK_NB 4 /* Don't block when locking. */
  35. /* Apply or remove an advisory lock, according to OPERATION,
  36. on the file FD refers to. */
  37. extern int flock (int __fd, int __operation) __THROW;
  38. __END_DECLS
  39. #endif /* sys/file.h */