lock_ops.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:"
  52. " compiled with FUTEX support which is not present in the"
  53. " running kernel (try 2.6+)\n");
  54. return -1;
  55. }
  56. #endif
  57. return 0;
  58. }
  59. void destroy_lock_ops(void)
  60. {
  61. }