Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

  1. #ifndef __FLOCK_HXX
  2. #define __FLOCK_HXX
  3. #include <wininetp.h>
  4. #include <mainwin.h>
  5. extern void ShowReadOnlyCacheDialog(char* pszHostName);
  6. #include <sys/types.h>
  7. #include <signal.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <sys/types.h>
  12. #include <sys/ipc.h>
  13. #include <errno.h>
  14. #include <sys/socket.h>
  15. #include <netinet/in.h>
  16. #include <arpa/inet.h>
  17. #if defined(UNIX) && defined(ux10)
  18. #undef M
  19. #include <net/if.h>
  20. #define M * 1048576
  21. #else
  22. #include <net/if.h>
  23. #endif
  24. #include <netinet/if_ether.h>
  25. #include <netdb.h>
  26. #define LF "lf"
  27. #define LOCKDBF "lockdbf"
  28. #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
  29. #define read_lock(fd, offset, whence, len) \
  30. lock_reg(fd, F_SETLK, F_RDLCK, offset, whence, len)
  31. #define readw_lock(fd, offset, whence, len) \
  32. lock_reg(fd, F_SETLKW, F_RDLCK, offset, whence, len)
  33. #define write_lock(fd, offset, whence, len) \
  34. lock_reg(fd, F_SETLK, F_WRLCK, offset, whence, len)
  35. #define writew_lock(fd, offset, whence, len) \
  36. lock_reg(fd, F_SETLKW, F_WRLCK, offset, whence, len)
  37. #define un_lock(fd, offset, whence, len) \
  38. lock_reg(fd, F_SETLK, F_UNLCK, offset, whence, len)
  39. #define can_readlock(fd, offset, whence, len) \
  40. lock_test(fd, F_RDLCK, offset, whence, len)
  41. #define can_writelock(fd, offset, whence, len) \
  42. lock_test(fd, F_WRLCK, offset, whence, len)
  43. #endif /* __FLOCK_HXX */