lock_ops.c 1.5 KB

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