lock_ops.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include "ut.h"
  27. #include "dprint.h"
  28. #include "lock_ops.h"
  29. /* returns 0 on success, -1 on error */
  30. int init_lock_ops()
  31. {
  32. #ifdef USE_FUTEX
  33. int os_ver;
  34. os_ver=get_sys_version(0, 0, 0);
  35. if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */
  36. LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:"
  37. " compiled with FUTEX support which is not present in the"
  38. " running kernel (try 2.6+)\n");
  39. return -1;
  40. }
  41. #endif
  42. return 0;
  43. }
  44. void destroy_lock_ops()
  45. {
  46. }