unistd.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This file is part of the Sofia-SIP package
  3. *
  4. * Copyright (C) 2006 Nokia Corporation.
  5. *
  6. * Contact: Pekka Pessi <pekka.pessi@nokia.com>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public License
  10. * as published by the Free Software Foundation; either version 2.1 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. /* Dummy unistd.h for win32 */
  25. #include <io.h>
  26. #include <fcntl.h>
  27. #include <stdio.h>
  28. #define write(fd, buf, len) _write((fd), (buf), (unsigned int)(len))
  29. #define read(fd, buf, len) _read((fd), (buf), (len))
  30. #define close(fd) _close((fd))
  31. #define mktemp(template) _mktemp((template))
  32. #define mkstemp(template) _open(_mktemp(template), _O_RDWR|_O_CREAT, 0600)
  33. #define unlink(name) _unlink((name))
  34. #define stat _stat
  35. #define O_RDONLY _O_RDONLY
  36. #define O_WRONLY _O_WRONLY
  37. #define O_RDWR _O_RDWR
  38. #define O_APPEND _O_APPEND
  39. #define O_CREAT _O_CREAT
  40. #define O_TRUNC _O_TRUNC
  41. #define O_EXCL _O_EXCL
  42. #include <process.h>
  43. #define getpid() _getpid()