os_root.c
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 1k
Category:

MySQL

Development Platform:

Visual C++

  1. /*-
  2.  * See the file LICENSE for redistribution information.
  3.  *
  4.  * Copyright (c) 1999, 2000
  5.  * Sleepycat Software.  All rights reserved.
  6.  */
  7. #include "db_config.h"
  8. #ifndef lint
  9. static const char revid[] = "$Id: os_root.c,v 11.4 2000/02/14 03:00:05 bostic Exp $";
  10. #endif /* not lint */
  11. #ifndef NO_SYSTEM_INCLUDES
  12. #include <sys/types.h>
  13. #include <unistd.h>
  14. #endif
  15. #include "db_int.h"
  16. /*
  17.  * __os_isroot --
  18.  * Return if user has special permissions.
  19.  *
  20.  * PUBLIC: int __os_isroot __P((void));
  21.  */
  22. int
  23. __os_isroot()
  24. {
  25. #ifdef HAVE_GETUID
  26. return (getuid() == 0);
  27. #else
  28. return (0);
  29. #endif
  30. }