lock_ops.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2007 iptelorg GmbH
  3. *
  4. * Permission to use, copy, modify, and distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /*!
  17. * \file
  18. * \brief Kamailio core :: lock operations init
  19. * \ingroup core
  20. *
  21. * Module: \ref core
  22. *
  23. * Reference:
  24. * - \ref LockingDoc
  25. */
  26. /*!
  27. * \page LockingDoc Documentation of locking
  28. * \verbinclude locking.txt
  29. *
  30. */
  31. #include "ut.h"
  32. #include "dprint.h"
  33. #include "lock_ops.h"
  34. /* returns 0 on success, -1 on error */
  35. int init_lock_ops(void)
  36. {
  37. #ifdef USE_FUTEX
  38. int os_ver;
  39. os_ver=get_sys_version(0, 0, 0);
  40. if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */
  41. LM_CRIT("old kernel: compiled with FUTEX support which is not"
  42. " present in the running kernel (try 2.6+)\n");
  43. return -1;
  44. }
  45. #endif
  46. return 0;
  47. }
  48. void destroy_lock_ops(void)
  49. {
  50. }